-
Notifications
You must be signed in to change notification settings - Fork 114
Add support for TeamCity parallel tests #1687
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
Conversation
| var filePath = RootDirectory / "excluded.runSettings"; | ||
| File.WriteAllText(filePath, runSettingsFile); | ||
|
|
||
| TeamCity.Instance.PublishArtifacts(filePath); |
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.
Publish the exclusion file for debugging
|
|
||
| static string? TryBuildExcludedTestsSettingsFile(string baseFilter) | ||
| { | ||
| var excludedTestsFile = Environment.GetEnvironmentVariable("TeamCityTestExclusionFilePath"); |
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 is added via a teamcity build template on the specific test build config
Jtango18
left a comment
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.
Looks like a useful change, Ship it!
To support parallel tests in TeamCity, we need to identify and parse the
excludedTests.txtfile that TeamCity generates for each parallel build. When teamcity splits the tests up for parallel builds, it sends an exclusion list to each parallel batch. It's in a format such asTo correctly filter the tests for each batch, we build a
.runSettingsfile and build a NunitWherequery that is the original filter plus all the excluded tests identified by TeamCity.Testing on TeamCity reduces the full chain time by approx. 20-30min.
It results in the same amount of tests being executed as on
main