Add deep-nested traversal e2e tests for dotnet test (MTP)#55407
Open
Evangelink wants to merge 1 commit into
Open
Add deep-nested traversal e2e tests for dotnet test (MTP)#55407Evangelink wants to merge 1 commit into
Evangelink wants to merge 1 commit into
Conversation
Adds TraversalTestProjectsDeepNested asset and RunDeeplyNestedTraversalProject_ShouldRunEveryReferencedTestProjectAndSkipNonTestProjects. The graph nests three levels of traversal (dirs.proj -> level2/dirs.proj -> level2/level3/dirs.proj) with a test project referenced at each level, plus a plain (non-test) class library referenced by the level-2 traversal. Using per-launch marker files, the test deterministically asserts every test project runs exactly once (proving recursion past a single level) and the non-test library is silently skipped with a ZeroTests exit code.
|
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
Adds end-to-end coverage in dotnet.Tests for dotnet test handling of deeply nested Microsoft.Build.Traversal graphs when using Microsoft.Testing.Platform test applications, including validation that non-test projects are skipped during execution.
Changes:
- Added a new deep-nested traversal test asset (
TraversalTestProjectsDeepNested) with a 3-level traversal graph and a non-test class library node. - Added a new e2e test asserting each referenced MTP test project runs exactly once across the deep traversal graph.
- Added explicit verification that a non-test project in the traversal graph produces zero launches (marker files) and does not affect the successful
ZeroTestsexit code.
Show a summary per file
| File | Description |
|---|---|
| test/TestAssets/TestProjects/TraversalTestProjectsDeepNested/dirs.proj | Top-level traversal project referencing level-1 test project and nested traversal. |
| test/TestAssets/TestProjects/TraversalTestProjectsDeepNested/level2/dirs.proj | Level-1 traversal referencing a test project, a non-test library, and a deeper traversal. |
| test/TestAssets/TestProjects/TraversalTestProjectsDeepNested/level2/level3/dirs.proj | Deepest traversal referencing the leaf test project. |
| test/TestAssets/TestProjects/TraversalTestProjectsDeepNested/global.json | Configures the test asset to use Microsoft.Testing.Platform runner. |
| test/TestAssets/TestProjects/TraversalTestProjectsDeepNested/Level1TestProject/Level1TestProject.csproj | MTP test application project used as a traversal node. |
| test/TestAssets/TestProjects/TraversalTestProjectsDeepNested/Level1TestProject/Program.cs | MTP dummy adapter + marker-file emission for deterministic run counting. |
| test/TestAssets/TestProjects/TraversalTestProjectsDeepNested/Level2TestProject/Level2TestProject.csproj | MTP test application project used as a traversal node. |
| test/TestAssets/TestProjects/TraversalTestProjectsDeepNested/Level2TestProject/Program.cs | MTP dummy adapter + marker-file emission for deterministic run counting. |
| test/TestAssets/TestProjects/TraversalTestProjectsDeepNested/DeepLeafTestProject/DeepLeafTestProject.csproj | MTP leaf test application project reachable only via deep nesting. |
| test/TestAssets/TestProjects/TraversalTestProjectsDeepNested/DeepLeafTestProject/Program.cs | MTP dummy adapter + marker-file emission for deterministic run counting. |
| test/TestAssets/TestProjects/TraversalTestProjectsDeepNested/NonTestLibrary/NonTestLibrary.csproj | Plain class library included in traversal graph to validate silent skip (no execution). |
| test/TestAssets/TestProjects/TraversalTestProjectsDeepNested/NonTestLibrary/Class1.cs | Minimal code file documenting intent of non-test project node. |
| test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs | Adds the deep-nested traversal e2e test asserting run counts and ZeroTests exit code. |
Copilot's findings
- Files reviewed: 13/13 changed files
- Comments generated: 0
drognanar
approved these changes
Jul 22, 2026
Evangelink
enabled auto-merge
July 22, 2026 14:47
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
Follow-up to #55297 (traversal support for
dotnet testwith Microsoft.Testing.Platform, now merged). Adds deeper end-to-end coverage for nested traversal projects.#55297 landed with basic and single-level-nested (diamond) traversal tests. This PR adds a three-level-deep nested traversal e2e test plus explicit coverage that non-test projects in the traversal graph are silently skipped — two cases not exercised by the merged tests.
What''s added
Test asset
TraversalTestProjectsDeepNested— a three-level traversal graph:Test
RunDeeplyNestedTraversalProject_ShouldRunEveryReferencedTestProjectAndSkipNonTestProjects(Debug + Release). Using the same deterministic per-launch marker-file technique as the existing diamond test, it asserts:Level1TestProject,Level2TestProject, andDeepLeafTestProjecteach run exactly once — proving recursion works past a single nesting level.NonTestLibrary(a plain class library referenced by the level-2 traversal) runs zero times and produces no error — proving non-test projects in the graph are silently skipped.ZeroTests.Validation
test/dotnet.Testsbuilds clean againstmain(0 warnings / 0 errors).Tests-only change; no product code touched.