Skip to content

Run test project target frameworks in parallel - #17161

Merged
Evangelink merged 8 commits into
dotnet:mainfrom
Evangelink:dev/amauryleve/parallelize-test-tfms
Aug 26, 2026
Merged

Evangelink merged 8 commits into
dotnet:mainfrom
Evangelink:dev/amauryleve/parallelize-test-tfms

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Summary

  • dispatch each target framework of a multi-targeted test project as a separate inner MSBuild build
  • enable parallel scheduling for those inner test builds
  • preserve generated test outputs for clean tracking
  • add a barrier-based regression test that fails when target frameworks run serially

Fixes #16581

Validation

  • Build.cmd -configuration Release -test

Dispatch each target framework through a parallel inner MSBuild invocation and add a barrier-based regression test.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: ed12a139-3ab6-45cc-8f6f-e01edba82614
Copilot AI review requested due to automatic review settings July 21, 2026 14:29

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

This PR updates Arcade SDK test infrastructure so that multi-targeted test projects run each target framework as a separate inner MSBuild invocation, enabling those TFM runs to be scheduled in parallel (addressing #16581).

Changes:

  • Switch Test/IntegrationTest to dispatch into _InnerRunTests or _OuterRunTests (per single-/multi-targeting) and run inner builds with BuildInParallel="true".
  • Add a functional regression test asset and xUnit test that deadlocks/fails if TFMs are executed serially.
  • Plumb FileWrites from inner test runs back to the outer target for correct output tracking.
Show a summary per file
File Description
src/Microsoft.DotNet.Arcade.Sdk/tools/Tests.targets Runs multi-target test TFMs as parallel inner MSBuild builds via _OuterRunTests and _InnerRunTests.
src/Microsoft.DotNet.Arcade.Sdk.Tests/testassets/ParallelTestTfms/ParallelTestTfms.proj New test asset project to validate parallel TFM execution.
src/Microsoft.DotNet.Arcade.Sdk.Tests/testassets/ParallelTestTfms/eng/Parallel/Parallel.targets Custom test runner targets implementing a barrier to fail when TFMs run serially.
src/Microsoft.DotNet.Arcade.Sdk.Tests/ParallelTestTfmsTests.cs New regression test that executes the asset and asserts success/expected artifacts.
src/Microsoft.DotNet.Arcade.Sdk.Tests/Microsoft.DotNet.Arcade.Sdk.Tests.csproj Copies Tests.targets into the specific test asset folder so the asset uses the PR’s version.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 1

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: ed12a139-3ab6-45cc-8f6f-e01edba82614
Copilot AI review requested due to automatic review settings July 21, 2026 14:52

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.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 1

Copilot AI review requested due to automatic review settings July 21, 2026 16:11

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Use writable Helix paths for functional test fixtures, simplify inner-build item construction, and normalize barrier paths across platforms.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: ed12a139-3ab6-45cc-8f6f-e01edba82614
Copilot AI review requested due to automatic review settings July 22, 2026 08:19

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.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 2

Treat empty Helix roots as unset and make the fake test runner produce and track its declared stdout artifact.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: ed12a139-3ab6-45cc-8f6f-e01edba82614
Copilot AI review requested due to automatic review settings July 22, 2026 10:27

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.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new

@Evangelink
Evangelink enabled auto-merge July 22, 2026 11:00
Preserve architecture inference and validation within each parallel inner TFM test build.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: ed12a139-3ab6-45cc-8f6f-e01edba82614
Copilot AI review requested due to automatic review settings July 23, 2026 08:28

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.

Copilot's findings

  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new

Copilot AI review requested due to automatic review settings July 27, 2026 11:12

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.

Copilot's findings

  • Files reviewed: 7/7 changed files
  • Comments generated: 3

- Select `_OuterRunTests` only when `TargetFramework` is empty and
  `TargetFrameworks` is set. Inner SDK builds keep `TargetFrameworks`
  populated, so invoking `Test` with `/p:TargetFramework=...` previously
  routed back through the outer path and ran every target framework.
- Normalize the `ParallelTestTfms` test asset paths with
  `$([MSBuild]::NormalizeDirectory(...))`/`NormalizePath(...)` instead of
  hard-coded backslashes so the on-disk layout agrees across OSes.
- Make the fake runner's barrier target framework list overridable via
  `ExpectedStartedTfms` and add the
  `ExplicitTargetFrameworkRunsOnlyThatTargetFramework` regression test.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 106468c8-3066-4c2f-b5f3-587cf05517dc
Copilot AI review requested due to automatic review settings July 27, 2026 11:28

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.

Copilot's findings

  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new

@Evangelink
Evangelink merged commit b3ee71a into dotnet:main Aug 26, 2026
10 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Aug 27, 2026
@ViktorHofer

Copy link
Copy Markdown
Member

@Evangelink squash merge next time please :)

@Evangelink

Copy link
Copy Markdown
Member Author

I'm so used to have it as the first and unique option on testfx that I didn't pay attention.

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.

Arcade test infra doesn't run TFMs of the same test project in parallel

5 participants