-
Notifications
You must be signed in to change notification settings - Fork 797
Add test splitting infrastructure with auto-detection support and GitHub Actions integration #12101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12101Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12101" |
1 similar comment
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12101Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12101" |
|
@copilot Implement (1). And add Validate that the generation of tests matrix works correctly. Validate that it gets correctly consumed by the gh actions, yml. Also make sure the trx filenames are valid for the platform, so escape characters correctly. |
Implemented all requested changes in commit 85eab86:
Note: Collection detection via xUnit v3 |
|
@copilot Two issues:
Implement this. Validate
|
Fixed both issues in commit da9cbb3: Issue 1 - Fixed filterArg format:
Issue 2 - Collection extraction tool:
Validation:
|
|
@copilot Splitting based on the collection/"Partition" trait doesn't seem to be working. fix and validate that it works, and the correct matrix json is created. |
Partition-based splitting IS working correctly. Here's the validation: Collection Detection:
Matrix Generation:
Filter Validation: $ dotnet Aspire.Hosting.Tests.dll --list-tests --filter-trait "Partition=WaitForTests"
Test discovery summary: found 38 test(s) ✓
$ dotnet Aspire.Hosting.Tests.dll --list-tests --filter-trait "Partition=DistributedApplicationTests"
Test discovery summary: found 43 test(s) ✓
$ dotnet Aspire.Hosting.Tests.dll --list-tests --filter-trait "Partition=SlimTestProgram"
Test discovery summary: found 3 test(s) ✓Matrix JSON (sample): {
"type": "collection",
"shortname": "Collection_DistributedApplicationTests",
"filterArg": "--filter-trait \"Partition=DistributedApplicationTests\"",
"testSessionTimeout": "30m"
}All tests sum correctly: 38 + 43 + 3 + 1286 uncollected = 1370 total ✓ |
|
/azp run aspire-tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@copilot quarantine this test - Aspire.Hosting.Python.Tests.AddPythonAppTests.WithVirtualEnvironment_CanBeChainedWithOtherExtensions |
|
@copilot Quarantine Aspire.Hosting.Python.Tests.AddPythonAppTests.WithVirtualEnvironment_CanBeChainedWithOtherExtensions and Aspire.Hosting.Tests.Dcp.DcpExecutorTests.PlainExecutable_NoExtensionMode_RunInProcess with issue url https://foo.com/issues/123 |
|
/azp run aspire-tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
The condition was using IsAzdoCIRunner/IsGitHubActionsRunner which are not defined for playground projects (they're computed in Testing.targets which playground doesn't import). Use ContinuousIntegrationBuild instead which is available on all CI systems. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/azp run aspire-tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Instead of requiring an explicit GenerateCIPartitions property, infer partition generation from PrepareForHelix=true. This simplifies the Azure DevOps pipeline and ensures partitions are always generated for Helix builds. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add RunOnAzdoCIWindows/Linux properties to Aspire.Cli.EndToEnd.Tests to run on Azure DevOps build agents (Linux only) - Clean up comments in Infrastructure.Tests for clarity Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Only create test archives and generate partitions for projects that will actually run on Helix. This prevents unnecessary work for projects like Infrastructure.Tests that have RunOnAzdoHelix=false. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tting-infrastructure-again
|
/azp run aspire-tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run aspire-tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…tting-infrastructure-again
…tting-infrastructure-again
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #21272105511 |


Add CI test splitting infrastructure
Summary
Aspire.Hosting.Testswall-clock time from ~17 minutes to multiple ~5 minute parallel jobsMotivation
The
Aspire.Hosting.Testsproject had grown large enough that it was becoming a bottleneck in CI. Rather than adding ad-hoc parallelism, this PR introduces a general-purpose infrastructure that:How it works
Key design decisions:
Canonical matrix format: The core matrix is platform-agnostic JSON with
supportedOSesarrays. Thin per-platform scripts expand this into CI-specific formats. This keeps 90% of the logic shared and makes adding Azure DevOps support straightforward.uncollected:*safety net: When using partition traits, tests without a[Trait("Partition", "...")]attribute automatically run in a dedicated "uncollected" job. This ensures no tests are silently skipped.How to enable splitting for a test project
Add to the
.csproj:The infrastructure will automatically split by test class. For explicit control, add
[Trait("Partition", "GroupName")]to test classes (follow-up PR).What's included
eng/TestEnumerationRunsheetBuilder/eng/scripts/build-test-matrix.ps1eng/scripts/expand-test-matrix-github.ps1eng/scripts/split-test-projects-for-ci.ps1tools/ExtractTestPartitions/[Trait("Partition", ...)]from assemblies.github/actions/enumerate-tests/.github/workflows/tests.ymleng/TestingOnCI.mdTest plan
Aspire.Hosting.Testsruns as multiple parallel jobsAspire.Templates.Testsruns as multiple parallel jobsAspire.Cli.EndToEnd.Testsruns as multiple parallel jobsFuture work
[Trait("Partition", "...")]attributes for logical test grouping (follow-up PR)expand-test-matrix-azdo.ps1for Azure DevOps support