-
Notifications
You must be signed in to change notification settings - Fork 266
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
[WIP] In assembly parallel #296
Merged
+2,799
−270
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
41c9616
WIP: In assembly parallelization at method level.
621da1b
WIP: Make ClassInitialize/Cleanup and AssemblyInitialize/Cleanup sync…
87c41cb
Run test class/assembly cleanups at end of execution.
912cc54
Test Class parallelization.
AbhitejJohn 95e912a
Added E2E tests.
AbhitejJohn 9377a41
Merge pull request #2 from AbhitejJohn/in-assembly-parallel
AbhitejJohn 550b70d
Runsettings support.
AbhitejJohn 560411e
Made Parallel platform independent.
AbhitejJohn 6262793
Merge pull request #3 from AbhitejJohn/in-assembly-parallel
AbhitejJohn 69a2392
nit refactoring and test fixes.
AbhitejJohn 9bd125b
Another nit fix.
AbhitejJohn c442547
Fixing test script to fail on test failures.
AbhitejJohn 93f3d8b
Some cleanup and a few UTs.
AbhitejJohn 26d68c8
Merge pull request #4 from AbhitejJohn/in-assembly-parallel
AbhitejJohn fa60189
Meged latest master.
AbhitejJohn 4f1dcef
few PR comments
AbhitejJohn 8c5b283
Merge pull request #5 from AbhitejJohn/in-assembly-parallel
AbhitejJohn ec72649
Changes based on spec.
AbhitejJohn 053969f
Exception handling for settings, unit tests and Disable Parallelization.
AbhitejJohn 4b37cba
Merge pull request #6 from AbhitejJohn/in-assembly-parallel
AbhitejJohn 5b51599
Fixed up E2E tests.
AbhitejJohn 7555ed1
Adding TestExecutionManager unit tests.
AbhitejJohn 7821679
Merge pull request #7 from AbhitejJohn/in-assembly-parallel
AbhitejJohn ee36c06
Reverting the UWP sdk upgrade since PR build machines are not on the …
AbhitejJohn 59882e6
Merge pull request #8 from AbhitejJohn/in-assembly-parallel
AbhitejJohn a2f5bfc
Updating localized files.
AbhitejJohn 1b9a78b
Merge pull request #9 from AbhitejJohn/in-assembly-parallel
AbhitejJohn fcecc7c
Staging changes for STA/MTA of parallized tests and a test.
AbhitejJohn d26387a
The TaskScheduler.FromCurrentSyncContext did not work. It appears tha…
AbhitejJohn 575ccc1
Merge pull request #10 from AbhitejJohn/in-assembly-parallel
AbhitejJohn 4a4637e
Merge branch 'master' into in-assembly-parallel
smadala 2f9c7ba
Really feel bad adding a sleep to a test - This can probably be handl…
AbhitejJohn 256151e
Merge pull request #11 from AbhitejJohn/in-assembly-parallel
AbhitejJohn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Made Parallel platform independent.
Support for DoNotParallelize at assembly level. Fixed up a loc'ing issue with test assembly being loaded in the main app domain. Runsettings parallel level taking precedence over assembly level setting.
commit 560411e4cc5e5577022bf3fda8e08d5aa0a1eedc
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
src/Adapter/MSTest.CoreAdapter/Execution/TestAssemblySettingsProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution | ||
{ | ||
using System; | ||
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; | ||
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; | ||
|
||
internal class TestAssemblySettingsProvider : MarshalByRefObject | ||
{ | ||
private ReflectHelper reflectHelper; | ||
|
||
public TestAssemblySettingsProvider() | ||
: this(new ReflectHelper()) | ||
{ | ||
} | ||
|
||
internal TestAssemblySettingsProvider(ReflectHelper reflectHelper) | ||
{ | ||
this.reflectHelper = reflectHelper; | ||
} | ||
|
||
public override object InitializeLifetimeService() | ||
{ | ||
return null; | ||
} | ||
|
||
internal TestAssemblySettings GetSettings(string source) | ||
{ | ||
var testAssemblySettings = new TestAssemblySettings(); | ||
|
||
// Load the source. | ||
var testAssembly = PlatformServiceProvider.Instance.FileOperations.LoadAssembly(source, isReflectionOnly: false); | ||
|
||
testAssemblySettings.ParallelLevel = this.reflectHelper.GetParallelizationLevel(testAssembly); | ||
|
||
if (testAssemblySettings.ParallelLevel == 0) | ||
{ | ||
testAssemblySettings.ParallelLevel = Environment.ProcessorCount; | ||
} | ||
|
||
testAssemblySettings.ParallelMode = this.reflectHelper.GetParallelizationMode(testAssembly); | ||
|
||
testAssemblySettings.CanParallelizeAssembly = !this.reflectHelper.IsDoNotParallelizeSet(testAssembly); | ||
|
||
return testAssemblySettings; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/Adapter/MSTest.CoreAdapter/ObjectModel/TestAssemblySettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel | ||
{ | ||
using System; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
[Serializable] | ||
internal class TestAssemblySettings | ||
{ | ||
/// <summary> | ||
/// Gets or sets the parallelization level. | ||
/// </summary> | ||
internal int ParallelLevel { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the mode of parallelization. | ||
/// </summary> | ||
internal TestParallelizationMode ParallelMode { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the assembly can be parallelized. | ||
/// </summary> | ||
internal bool CanParallelizeAssembly { get; set; } | ||
} | ||
} |
11 changes: 10 additions & 1 deletion
11
src/Adapter/MSTest.CoreAdapter/Resources/Resource.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -299,4 +299,7 @@ | |
<data name="DiscoveryWarning" xml:space="preserve"> | ||
<value>[MSTest][Discovery][{0}] {1}</value> | ||
</data> | ||
<data name="TestParallelizationBanner" xml:space="preserve"> | ||
<value>MSTest Executor: Test Parallelization enabled. Parallel Level {0}, Parallel Mode {1}</value> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to update string before merge. It may not have |
||
</data> | ||
</root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we build an abstraction for
TestSource
? There seem to be multiple data associated with a test assembly and it is currently fragmented. E.g. we pass insource
, maintain a stateisDeploymentCompleted
etc.. And now we're adding parallelization related configuration. These are effectively a per source property.The TestSource could be serializable.