Add more multithreaded tests#12994
Merged
OvesN merged 17 commits intodotnet:mainfrom Apr 28, 2026
Merged
Conversation
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced Apr 20, 2026
Closed
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new command-line end-to-end test project intended to exercise /mt (multithreaded) MSBuild execution using small on-disk test assets, and refactors an existing BuildCheck E2E test helper to use FileUtilities.CopyDirectory.
Changes:
- Introduce
Microsoft.Build.CommandLine.EndToEnd.Testswith/mtbuild + binlog replay scenarios and a shared fixture for restoring/copying test assets. - Add new SDK-style and non-SDK-style test asset projects used by the E2E tests.
- Replace custom recursive copy logic in
BuildCheck.UnitTestswithFileUtilities.CopyDirectory.
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/MSBuild/AssemblyInfo.cs | Adds IVT for the new EndToEnd test assembly. |
| src/MSBuild.EndToEnd.Tests/Microsoft.Build.CommandLine.EndToEnd.Tests.csproj | New E2E test project wired into the repo build. |
| src/MSBuild.EndToEnd.Tests/MultithreadedExecution_Tests.cs | New /mt end-to-end tests that spawn bootstrapped MSBuild. |
| src/MSBuild.EndToEnd.Tests/TestAssetsFixture.cs | New fixture to pre-restore selected test assets. |
| src/MSBuild.EndToEnd.Tests/TestSolutionAsset.cs | New lightweight model for identifying test assets. |
| src/MSBuild.EndToEnd.Tests/TestAssets/SingleProject/global.json | Prevents SDK resolution walking up to repo settings during tests. |
| src/MSBuild.EndToEnd.Tests/TestAssets/SingleProject/SingleProject.csproj | SDK-style single-project test asset. |
| src/MSBuild.EndToEnd.Tests/TestAssets/SingleProject/Program.cs | Source file for the single-project asset. |
| src/MSBuild.EndToEnd.Tests/TestAssets/ProjectWithDependencies/global.json | Prevents SDK resolution walking up to repo settings during tests. |
| src/MSBuild.EndToEnd.Tests/TestAssets/ProjectWithDependencies/ConsoleApp/ConsoleApp.csproj | SDK-style app referencing multiple libraries. |
| src/MSBuild.EndToEnd.Tests/TestAssets/ProjectWithDependencies/ConsoleApp/Program.cs | App entry point for dependency-graph asset. |
| src/MSBuild.EndToEnd.Tests/TestAssets/ProjectWithDependencies/Library1/Library1.csproj | SDK-style library project (dependency graph). |
| src/MSBuild.EndToEnd.Tests/TestAssets/ProjectWithDependencies/Library1/Class1.cs | Source file for Library1. |
| src/MSBuild.EndToEnd.Tests/TestAssets/ProjectWithDependencies/Library2/Library2.csproj | SDK-style library referencing Library3/4. |
| src/MSBuild.EndToEnd.Tests/TestAssets/ProjectWithDependencies/Library2/Class2.cs | Source file for Library2. |
| src/MSBuild.EndToEnd.Tests/TestAssets/ProjectWithDependencies/Library3/Library3.csproj | SDK-style library project. |
| src/MSBuild.EndToEnd.Tests/TestAssets/ProjectWithDependencies/Library3/Class3.cs | Source file for Library3. |
| src/MSBuild.EndToEnd.Tests/TestAssets/ProjectWithDependencies/Library4/Library4.csproj | SDK-style library project. |
| src/MSBuild.EndToEnd.Tests/TestAssets/ProjectWithDependencies/Library4/Class4.cs | Source file for Library4. |
| src/MSBuild.EndToEnd.Tests/TestAssets/NonSdkSingleProject/NonSdkSingleProject.csproj | Non-SDK-style .NET Framework project asset. |
| src/MSBuild.EndToEnd.Tests/TestAssets/NonSdkSingleProject/Program.cs | Source file for non-SDK single-project asset. |
| src/MSBuild.EndToEnd.Tests/TestAssets/NonSdkProjectWithDependencies/ConsoleApp/ConsoleApp.csproj | Non-SDK-style app referencing non-SDK libraries. |
| src/MSBuild.EndToEnd.Tests/TestAssets/NonSdkProjectWithDependencies/ConsoleApp/Program.cs | App entry point for non-SDK dependency-graph asset. |
| src/MSBuild.EndToEnd.Tests/TestAssets/NonSdkProjectWithDependencies/Library1/Library1.csproj | Non-SDK-style library project. |
| src/MSBuild.EndToEnd.Tests/TestAssets/NonSdkProjectWithDependencies/Library1/Class1.cs | Source file for non-SDK Library1. |
| src/MSBuild.EndToEnd.Tests/TestAssets/NonSdkProjectWithDependencies/Library2/Library2.csproj | Non-SDK-style library project. |
| src/MSBuild.EndToEnd.Tests/TestAssets/NonSdkProjectWithDependencies/Library2/Class2.cs | Source file for non-SDK Library2. |
| src/Framework/Properties/AssemblyInfo.cs | Adds IVT for the EndToEnd test assembly (enables internal helpers like FileUtilities). |
| src/BuildCheck.UnitTests/EndToEndTests.cs | Switches to FileUtilities.CopyDirectory and removes custom recursive copy helper. |
| src/Build/AssemblyInfo.cs | Adds IVT for the EndToEnd test assembly. |
| MSBuild.slnx | Adds the new EndToEnd test project to the solution. |
- Rename csproj from Microsoft.Build.CommandLine.EndToEnd.Tests to Microsoft.Build.EndToEnd.Tests - Delete InternalsVisibleTo in Build and MSBuild assemblies - Increase restore timeout to 120s to reduce CI flakiness - Route fixture output via IMessageSink for diagnostics - Remove unnecessary IDisposable from TestSolutionAssetsFixture - Fix inaccurate XML doc comments on BuildAndVerify and ProjectPath - Add binlog non-empty assertion - Increase test timeout to 180s
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
AR-May
commented
Apr 26, 2026
Member
Author
|
LGTM! |
JanProvaznik
approved these changes
Apr 28, 2026
Member
JanProvaznik
left a comment
There was a problem hiding this comment.
lgtm after comments resolved
Make TestSolutionAsset and TestAssetsFixture internal Improve comments in TestAssetsFixture Add project with dependencies to binaryLogging tests.
This was referenced Apr 28, 2026
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.
Fixes #12640
Context
End-to-end tests for building test projects with
/mtmode were added.Tests for:
SDK assets:
Non-SDK assets:
Changes Made
MSBuild.EndToEnd.Teststest project.Testing
End-to-end tests in
MultithreadedExecution_Tests.cs:MultithreadedBuild_Success— SDK-style builds with various/mtcombinations.MultithreadedBuild_BinaryLogging— SDK-style build with binlog + replay.MultithreadedBuild_NonSdkStyle_Success— non-SDK builds (Windows-only).MultithreadedBuild_NonSdkStyle_BinaryLogging— non-SDK binlog + replay (Windows-only).