Repository navigation
Parallelize additional MSTest unit suites - #55964
Merged
Merged
Conversation
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Enable class-level MSTest parallelism while removing process-wide environment mutations and restoring test culture changes. Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables additional MSTest parallel execution across several unit test projects and adjusts specific tests to improve isolation under concurrent execution (culture restoration, log isolation, environment-variable virtualization, and targeted serialization via ResourceLock).
Changes:
- Opts specific test projects into MSTest parallelization (
MethodLevelfor ApiDiff/ApiCompatibility;ClassLevelfor several TemplateEngine and CLI util test suites). - Restores ambient
CultureInfo.CurrentCulture(and wraps TemplateEngine environment creation to avoid leakingCurrentUICulture) in culture-sensitive tests. - Hardens ApiCompatibility tests by removing shared log instances and serializing assembly emission with
[ResourceLock].
Show a summary per file
| File | Description |
|---|---|
| test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/ValueFormTests/FirstUpperCaseValueFormTests.cs | Restores CurrentCulture around culture-dependent value-form assertions. |
| test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/ValueFormTests/FirstUpperCaseInvariantValueFormModel.cs | Restores CurrentCulture around invariant value-form assertions. |
| test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/ValueFormTests/FirstLowerCaseValueFormTests.cs | Restores CurrentCulture around culture-dependent value-form assertions. |
| test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/ValueFormTests/FirstLowerCaseInvariantValueFormTests.cs | Restores CurrentCulture around invariant value-form assertions. |
| test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests.csproj | Enables class-level MSTest parallelization for the RunnableProjects unit tests. |
| test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/BindSymbolTests.cs | Removes process-level environment mutation and introduces a helper for virtualized env-var access. |
| test/TemplateEngine/Microsoft.TemplateEngine.Core.UnitTests/VariablesTests.cs | Routes environment creation through shared helper to avoid leaking ambient culture state. |
| test/TemplateEngine/Microsoft.TemplateEngine.Core.UnitTests/TestBase.cs | Adds helper that restores CurrentUICulture after creating TemplateEngine test environments. |
| test/TemplateEngine/Microsoft.TemplateEngine.Core.UnitTests/SetFlagTests.cs | Uses the new environment-creation helper for isolation. |
| test/TemplateEngine/Microsoft.TemplateEngine.Core.UnitTests/ReplacementTests.cs | Uses the new environment-creation helper for isolation. |
| test/TemplateEngine/Microsoft.TemplateEngine.Core.UnitTests/RegionTests.cs | Uses the new environment-creation helper for isolation. |
| test/TemplateEngine/Microsoft.TemplateEngine.Core.UnitTests/OrchestratorTests.cs | Uses the new environment-creation helper and updates test base type. |
| test/TemplateEngine/Microsoft.TemplateEngine.Core.UnitTests/Microsoft.TemplateEngine.Core.UnitTests.csproj | Enables class-level MSTest parallelization for the TemplateEngine Core unit tests. |
| test/TemplateEngine/Microsoft.TemplateEngine.Core.UnitTests/LookaroundTests.cs | Uses the new environment-creation helper for isolation. |
| test/TemplateEngine/Microsoft.TemplateEngine.Core.UnitTests/ConditionalTests.CStyleEvaluator.cs | Restores CurrentCulture around culture-dependent conditional processing assertions. |
| test/TemplateEngine/Microsoft.TemplateEngine.Core.UnitTests/ConditionalTests.cs | Routes environment creation through shared helper to avoid leaking ambient culture state. |
| test/TemplateEngine/Microsoft.TemplateEngine.Core.UnitTests/ChunkStreamReadTests.cs | Uses the new environment-creation helper for isolation. |
| test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj | Enables class-level MSTest parallelization for CLI utils tests. |
| test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Microsoft.DotNet.ApiDiff.Tests.csproj | Enables method-level MSTest parallelization for ApiDiff tests. |
| test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Rules/AssemblyIdentityMustMatchTests.cs | Removes shared log state and serializes assembly emission with [ResourceLock]. |
| test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Microsoft.DotNet.ApiCompatibility.Tests.csproj | Enables method-level MSTest parallelization for ApiCompatibility tests. |
Review details
- Files reviewed: 21/21 changed files
- Comments generated: 1
- Review effort level: Lite
Evangelink
enabled auto-merge
August 27, 2026 12:24
Wrap DefaultEnvironment so the bind-symbol test overrides only its target variable while preserving realistic behavior for every other IEnvironment member. Co-authored-by: Copilot App <[email protected]> Copilot-Session: fac66858-910b-458a-9c6d-6b6844f31c97
JeremyKuhne
approved these changes
Aug 28, 2026
Evangelink
had a problem deploying
to
copilot-pat-pool
August 28, 2026 02:07 — with
GitHub Actions
Failure
This branch had an error being deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ResourceLock, restoring ambient cultures, virtualizing environment-variable access, and isolating Template Engine host identifiers.Test evidence
Validated on the creator branch before extracting this reviewable tranche: