Skip to content

Add deep-nested traversal e2e tests for dotnet test (MTP)#55407

Open
Evangelink wants to merge 1 commit into
mainfrom
dev/amauryleve/traversal-deep-nested-e2e-tests
Open

Add deep-nested traversal e2e tests for dotnet test (MTP)#55407
Evangelink wants to merge 1 commit into
mainfrom
dev/amauryleve/traversal-deep-nested-e2e-tests

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Summary

Follow-up to #55297 (traversal support for dotnet test with 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:

dirs.proj               (level 0) -> Level1TestProject, level2/dirs.proj
level2/dirs.proj        (level 1) -> Level2TestProject, NonTestLibrary, level2/level3/dirs.proj
level2/level3/dirs.proj (level 2) -> DeepLeafTestProject

Test RunDeeplyNestedTraversalProject_ShouldRunEveryReferencedTestProjectAndSkipNonTestProjects (Debug + Release). Using the same deterministic per-launch marker-file technique as the existing diamond test, it asserts:

  • Level1TestProject, Level2TestProject, and DeepLeafTestProject each 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.
  • The overall exit code is ZeroTests.

Validation

Tests-only change; no product code touched.

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.
Copilot AI review requested due to automatic review settings July 22, 2026 13:33
@Evangelink
Evangelink requested a review from a team as a code owner July 22, 2026 13:33
@azure-pipelines

Copy link
Copy Markdown
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ZeroTests exit 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

@Evangelink
Evangelink enabled auto-merge July 22, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants