-
Notifications
You must be signed in to change notification settings - Fork 331
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
Enable parallelization of acceptance tests #3268
Conversation
test/Microsoft.TestPlatform.AcceptanceTests/BlameDataCollectorTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/DiscoverTests.cs
Show resolved
Hide resolved
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.
Nice. I think we jumped too ahead of ourselves with the WrapperContext, the additional property is used in only 1 or two tests, and we initialize it in the constructor, so I would prefer having the tests use the IVSTestConsoleWrapper directly, to minimize the changes. And where it is needed you can add additional property to the test class that would hold the additional info. Maybe GetVstestConsoleWrapper could return out parameter that would have an object holding that info?
test/Microsoft.TestPlatform.AcceptanceTests/TestPlatformNugetPackageTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/CodeCoverageTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/DiscoverTests.cs
Show resolved
Hide resolved
test/Microsoft.TestPlatform.AcceptanceTests/BlameDataCollectorTests.cs
Outdated
Show resolved
Hide resolved
this.ValidateSummaryStatus(2, 2, 2); | ||
|
||
string mergedFile = Directory.GetFiles(resultsDir, "MergedFile.txt", SearchOption.AllDirectories).Single(); | ||
string mergedFile = Directory.GetFiles(workspace.Path, "MergedFile.txt", SearchOption.AllDirectories).Single(); |
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 can also think to add GetFiles to workspace...it's a common task search for files.
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.
Yup, I had that in my original proposal as well. So maybe as a second step?
@@ -19,3 +20,6 @@ | |||
|
|||
// The following GUID is for the ID of the typelib if this project is exposed to COM | |||
[assembly: Guid("755996fa-672a-4272-9776-7f707a520058")] | |||
|
|||
// Enable IAP at method level with as many threads as possible based on CPU and core count. | |||
[assembly: Parallelize(Workers = 0, Scope = ExecutionScope.MethodLevel)] |
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 creates dotnet hosted vstest console and 2 testhosts one of which is hosted | ||
// in dotnet, so we have two dotnet + 1 testhost.exe | ||
expectedProcessCreated = 3; |
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.
is it ok to remove?
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.
Yes, this was a special case for the thing described in the comment. We no longer count processes by observing which process started during run. But rather by counting the number of diagnostic logs for host that were produced during run. This makes it possible to run in parallel, and is less fragile in case where vstest.console and testhost both run under dotnet.exe apphost (which is the special case above where we have 2 dlls, running in 2 dotnet testhost.dll, but also 1 dotnet vstest.console.dll, and we could not distinguish which dotnet.exe is actually hosting testhost, and which is hosting vstest.console, so we counted 3 in total).
test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/CodeCoverageTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.TestPlatform.AcceptanceTests/ArgumentProcessorTests.cs
Outdated
Show resolved
Hide resolved
@@ -36,7 +37,7 @@ public static void ClassCleanup() | |||
{ | |||
try | |||
{ | |||
Directory.Delete(privateX64Installation, true); | |||
new DirectoryInfo(privateX64Installation).Parent.Delete(true); |
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 Parent?
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.
In the init we do a temp dir with a subfolder named x64
and we keep a reference to the sub-folder, so I want to clean the right folder (i.e. the parent).
Description
Update acceptance tests to enable parallelization.
Related issue
Fixes AB#1463179