-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling performance tests #1796
Conversation
@dsplaisted |
Hard to see what changed from #1718. Why did you drop @dsplaisted's commits and attribution? |
@@ -110,6 +110,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Build.Tests", | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Pack.Tests", "src\Tests\Microsoft.NET.Pack.Tests\Microsoft.NET.Pack.Tests.csproj", "{8746DC05-3035-4F24-9F2C-BAAAB5B50FD3}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Perf.Tests", "src\Tests\Microsoft.NET.Perf.Tests\Microsoft.NET.Perf.Tests.csproj", "{AFB72217-54A0-4E76-870A-42718B8E0AE5}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want the perf tests to run as part of the unit test switch, or do we want them to run separately (which, I believe, is what most of the other repos are doing)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want the perf tests to run with a single iteration during normal tests. That will ensure that they don't get functionally broken. When running in the perf lab, they should run with more iterations, but this will only happen automatically after a PR is merged (though it will be possible to request a perf run for an unmerged PR).
@nguerrera |
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="1.0.3-alpha-experimental" /> | ||
<PackageReference Include="Microsoft.DotNet.Cli.Utils" Version="$(MicrosoftDotNetCliUtilsVersion)" /> | ||
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" /> | ||
<PackageReference Include="xunit.performance.api" Version="1.0.0-beta-build0011" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a variable $(XUnitPerformanceApiVersion)
@@ -24,7 +24,9 @@ public BuildPerf(ITestOutputHelper log) : base(log) | |||
|
|||
// These tests are currently disabled for full framework MSBuild because the CI machines don't | |||
// have an MSBuild that supports the /restore command-line argument | |||
[CoreMSBuildOnlyTheory] | |||
// Also, Microsoft.Xunit.Performance.Api.ProcessExitInfo doesn't handle non-Windows | |||
// information gathering - disabling for non-Windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please file a bug for this in https://github.com/microsoft/xunit-performance/issues and link to that issue in this comment.
// These tests are currently disabled for full framework MSBuild because the CI machines don't | ||
// have an MSBuild that supports the /restore command-line argument | ||
// Also, Microsoft.Xunit.Performance.Api.ProcessExitInfo doesn't handle non-Windows | ||
// information gathering - disabling for non-Windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File a bug in https://github.com/Microsoft/xunit-performance for this, and link to it from this comment.
<Copy SourceFiles="@(_CopyDirectoryBuildTestDependenciesInput)" | ||
DestinationFiles="@(_CopyDirectoryBuildTestDependenciesOutput)" /> | ||
<Target Name="_CopyDirectoryBuildTestDependencies" AfterTargets="Build" Inputs="@(_CopyDirectoryBuildTestDependenciesInput)" Outputs="@(_CopyDirectoryBuildTestDependenciesOutput)"> | ||
<Copy SourceFiles="@(_CopyDirectoryBuildTestDependenciesInput)" DestinationFiles="@(_CopyDirectoryBuildTestDependenciesOutput)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it's just a formatting change (probably by Visual Studio). Revert this.
|
||
namespace Microsoft.NET.Perf.Tests | ||
{ | ||
public class PerfTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that both perf frameworks provided infrastructure for all this. Why are we writing our own?
TestName = TestName ?? callerName; | ||
|
||
Stopwatch stopwatch = new Stopwatch(); | ||
TimeSpan[] executionTimes = new TimeSpan[NumberOfIterations]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stopwatch
and executionTimes
variables are left over from previous versions of the code and should now be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed...
Overall it looks ok. However, I would like to see the following:
|
@@ -88,6 +89,16 @@ | |||
<LayoutFile Include="@(PackFile)"> | |||
<TargetPath>..\NuGet.Build.Tasks.Pack\%(PackFile.RecursiveDir)%(PackFile.Filename)%(PackFile.Extension)</TargetPath> | |||
</LayoutFile> | |||
|
|||
<!-- Include some of the Sdks from the Stage 0 CLI for performance tests--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these the SDK files that the CLI requires that are not produced by dotnet/sdk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are SDK files that the Performance tests require that are not produced by dotnet/sdk
} | ||
|
||
[CoreMSBuildOnlyTheory(Skip ="The code for these scenarios needs to be acquired during the test run (instead of relying on hard-coded local path)")] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: empty line here seems weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed...
|
||
var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: operation.ToString()); | ||
|
||
TestProject(testAsset.Path, ".NET Core 2 Console App", operation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name, TestProject, does it mean go run a test on the project or is it a more of a name to create TestProject, which happens to do things like build.
The name seems strange here. Does not read like an action. At least, I didn't read it as such at first.
{ | ||
string OriginalPath { get; set; } | ||
string BackupPath { get; set; } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: there is an extra empty line here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed...
|
||
public static FolderSnapshot Create(string path) | ||
{ | ||
FolderSnapshot ret = new FolderSnapshot(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this called ret?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed...
{ | ||
Directory.Delete(dest, true); | ||
} | ||
CopyDirectory(source, dest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: empty line after closing brackets. Check this in the rest of the files.
We should add this to our editorconfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed...
} | ||
|
||
[Fact] | ||
public void ShowToolsetPaths() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this test doing?
} | ||
|
||
protected override SdkCommandSpec CreateCommand(string[] args) | ||
{ | ||
return new SdkCommandSpec() | ||
var ret = new SdkCommandSpec() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ret? better name please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed...
* First draft enabling performance tests... * Resolved BUG: microsoft/xunit-performance#248
* First draft enabling performance tests... * Disabling tests for non-Windows... * Updates... * Missing "\" * Set 'DefaultIterations' to "1" * Resolved BUG: microsoft/xunit-performance#248 * Fixing typos... * Formatting, variable names changes. * Fixing a typo...
No description provided.