Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e3017e9
Add ExtractTestPartitions tool for test enumeration
radical Jan 21, 2026
45d3050
Add PowerShell scripts for test matrix building and splitting
radical Jan 21, 2026
7655ce9
Add MSBuild infrastructure for test enumeration
radical Jan 21, 2026
d706d63
Update test projects with CI splitting configuration
radical Jan 21, 2026
53cebf1
Update GitHub workflows to use test splitting infrastructure
radical Jan 21, 2026
d2261cd
Add Infrastructure.Tests project for CI tooling tests
radical Jan 21, 2026
4152713
Add documentation for CI test splitting infrastructure
radical Jan 21, 2026
848fcc3
Update Helix targets and remove obsolete GetTestProjects.proj
radical Jan 21, 2026
b311ab5
Add JSON output format documentation to enumerate-tests action
radical Jan 21, 2026
9465864
Use ArgumentList instead of string concatenation for process args
radical Jan 21, 2026
6f3f55c
Simplify canonical test matrix to flat array format
radical Jan 21, 2026
dcc3a9c
Merge remote-tracking branch 'origin/main' into copilot/add-test-spli…
radical Jan 21, 2026
2b961b8
remove aspire.hosting.tests changes
radical Jan 21, 2026
c611780
Fail if test listing command returns non-zero exit code
radical Jan 21, 2026
8d50613
Address PR review comments
radical Jan 21, 2026
8076673
Pass GenerateCIPartitions=true in Azure DevOps Helix build
radical Jan 21, 2026
7ca1fcd
Exclude Infrastructure.Tests from Helix runs
radical Jan 21, 2026
58a4b9d
Merge remote-tracking branch 'origin/main' into copilot/add-test-spli…
radical Jan 21, 2026
44e7497
Fix ArchiveTests evaluation order so RunOnAzdoHelix is respected
radical Jan 21, 2026
37cf76d
Fix SkipTests condition for playground test project
radical Jan 21, 2026
70adafe
Generate test partitions when PrepareForHelix=true
radical Jan 21, 2026
0b47aeb
Configure CI agent settings for CLI E2E and Infrastructure tests
radical Jan 21, 2026
23f2101
fix cli.endtoendtests
radical Jan 21, 2026
a9abd28
Skip test archiving and partition generation when RunOnAzdoHelix!=true
radical Jan 22, 2026
0f35c32
fix condition to archivetests
radical Jan 22, 2026
437b6f5
Merge remote-tracking branch 'origin/main' into copilot/add-test-spli…
radical Jan 22, 2026
d696787
Fix up conditions to archive tests
radical Jan 22, 2026
3e44334
fix condition
radical Jan 22, 2026
37e5afa
fix up condition
radical Jan 22, 2026
3477534
fixy
radical Jan 22, 2026
9aa3b15
Merge remote-tracking branch 'origin/main' into copilot/add-test-spli…
radical Jan 22, 2026
246a758
Merge remote-tracking branch 'origin/main' into copilot/add-test-spli…
radical Jan 23, 2026
2d1f868
fix
radical Jan 23, 2026
b2d5ff4
fixy
radical Jan 23, 2026
30e65ce
Merge remote-tracking branch 'origin/main' into copilot/add-test-spli…
radical Jan 24, 2026
a7b14cb
fix merge
radical Jan 24, 2026
f9ebad7
fixy
radical Jan 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 45 additions & 93 deletions .github/actions/enumerate-tests/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: 'Enumerate test projects'
description: 'Enumerate list of test projects'
inputs:
includeIntegrations:
required: false
type: boolean
default: false
includeTemplates:
required: false
type: boolean
Expand All @@ -14,16 +10,26 @@ inputs:
type: boolean
default: false

# Output format: JSON with structure {"include": [{...}, ...]}
# Each entry contains:
# - type: 'regular' | 'collection' | 'class'
# - projectName: Full project name (e.g., 'Aspire.Hosting.Tests')
# - name: Display name for the test run
# - shortname: Short identifier
# - testProjectPath: Relative path to the test project
# - workitemprefix: Prefix for work item naming
# - runs-on: GitHub Actions runner (e.g., 'ubuntu-latest', 'windows-latest')
# - testSessionTimeout: Timeout for the test session (e.g., '20m')
# - testHangTimeout: Timeout for hung tests (e.g., '10m')
# - requiresNugets: Boolean indicating if NuGet packages are needed
# - requiresTestSdk: Boolean indicating if test SDK is needed
# - extraTestArgs: Additional test arguments (e.g., '--filter-trait "Partition=P1"')
# - collection: (collection type only) Collection/partition name
# - classname: (class type only) Fully qualified test class name
outputs:
integrations_tests_matrix:
description: Integration tests matrix
value: ${{ steps.generate_integrations_matrix.outputs.integrations_tests_matrix }}
templates_tests_matrix:
description: Templates tests matrix
value: ${{ steps.generate_templates_matrix.outputs.templates_tests_matrix }}
cli_e2e_tests_matrix:
description: Cli E2E tests matrix
value: ${{ steps.generate_cli_e2e_matrix.outputs.cli_e2e_tests_matrix }}
tests_matrix:
description: Canonical tests matrix for all tests
value: ${{ steps.generate_canonical_matrix.outputs.tests_matrix }}
runs:
using: "composite"
steps:
Expand All @@ -35,92 +41,36 @@ runs:
with:
global-json-file: ${{ github.workspace }}/global.json

- name: Get list of integration tests
if: ${{ inputs.includeIntegrations }}
shell: pwsh
run: >
dotnet build ${{ github.workspace }}/tests/Shared/GetTestProjects.proj
/bl:${{ github.workspace }}/artifacts/log/Debug/GetTestProjects.binlog
/p:TestsListOutputPath=${{ github.workspace }}/artifacts/TestsForGithubActions.list
/p:ContinuousIntegrationBuild=true
- name: Restore
shell: bash
run: ./restore.sh

- name: Generate list of template tests
if: ${{ inputs.includeTemplates }}
shell: pwsh
- name: Generate canonical test matrix
shell: bash
run: >
dotnet build ${{ github.workspace }}/tests/Aspire.Templates.Tests/Aspire.Templates.Tests.csproj
"/t:Build;ExtractTestClassNames"
/bl:${{ github.workspace }}/artifacts/log/Debug/BuildTemplatesTests.binlog
-p:ExtractTestClassNamesForHelix=true
-p:PrepareForHelix=true
-p:ExtractTestClassNamesPrefix=Aspire.Templates.Tests
-p:InstallBrowsersForPlaywright=false
./build.sh -test
/p:TestRunnerName=TestEnumerationRunsheetBuilder
/p:TestMatrixOutputPath=artifacts/canonical-test-matrix.json
/p:IncludeTemplateTests=${{ inputs.includeTemplates }}
/p:IncludeCliE2ETests=${{ inputs.includeCliE2E }}
/p:GenerateCIPartitions=true
/bl

- name: Generate list of CLI E2E tests
if: ${{ inputs.includeCliE2E }}
shell: pwsh
run: >
dotnet build ${{ github.workspace }}/tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj
"/t:Build;ExtractTestClassNames"
/bl:${{ github.workspace }}/artifacts/log/Debug/BuildCliEndToEndTests.binlog
-p:ExtractTestClassNamesForHelix=true
-p:PrepareForHelix=true
-p:ExtractTestClassNamesPrefix=Aspire.Cli.EndToEnd.Tests
-p:InstallBrowsersForPlaywright=false

- name: Generate tests matrix
id: generate_integrations_matrix
if: ${{ inputs.includeIntegrations }}
- name: Expand matrix for GitHub Actions
id: generate_canonical_matrix
shell: pwsh
run: |
$filePath = "${{ github.workspace }}/artifacts/TestsForGithubActions.list"
$lines = Get-Content $filePath
$jsonObject = @{
"shortname" = $lines | Sort-Object
}
$jsonString = ConvertTo-Json $jsonObject -Compress
"integrations_tests_matrix=$jsonString"
"integrations_tests_matrix=$jsonString" | Out-File -FilePath $env:GITHUB_OUTPUT

- name: Generate templates matrix
id: generate_templates_matrix
if: ${{ inputs.includeTemplates }}
shell: pwsh
run: |
$inputFilePath = "${{ github.workspace }}/artifacts/helix/templates-tests/Aspire.Templates.Tests.tests.list"
$lines = Get-Content $inputFilePath

$prefix = "Aspire.Templates.Tests."
$lines = Get-Content $inputFilePath | ForEach-Object {
$_ -replace "^$prefix", ""
}

$jsonObject = @{
"shortname" = $lines | Sort-Object
}
$jsonString = ConvertTo-Json $jsonObject -Compress
"templates_tests_matrix=$jsonString"
"templates_tests_matrix=$jsonString" | Out-File -FilePath $env:GITHUB_OUTPUT

- name: Generate cli e2e matrix
id: generate_cli_e2e_matrix
if: ${{ inputs.includeCliE2E }}
shell: pwsh
run: |
$inputFilePath = "${{ github.workspace }}/artifacts/helix/cli-e2e-tests/Aspire.Cli.EndToEnd.Tests.tests.list"
$lines = Get-Content $inputFilePath

$prefix = "Aspire.Cli.EndToEnd.Tests."
$lines = @(Get-Content $inputFilePath | ForEach-Object {
$_ -replace "^$prefix", ""
})
$canonicalMatrixPath = "${{ github.workspace }}/artifacts/canonical-test-matrix.json"
$expandScript = "${{ github.workspace }}/eng/scripts/expand-test-matrix-github.ps1"

$jsonObject = @{
"shortname" = @($lines | Sort-Object)
if (Test-Path $canonicalMatrixPath) {
& $expandScript -CanonicalMatrixFile $canonicalMatrixPath -OutputToGitHubEnv
} else {
# Empty matrix if no canonical matrix found
$emptyMatrix = '{"include":[]}'
"tests_matrix=$emptyMatrix" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
Write-Host "No canonical test matrix found, using empty matrix"
}
$jsonString = ConvertTo-Json $jsonObject -Compress
"cli_e2e_tests_matrix=$jsonString"
"cli_e2e_tests_matrix=$jsonString" | Out-File -FilePath $env:GITHUB_OUTPUT

- name: Upload logs
if: always()
Expand All @@ -129,4 +79,6 @@ runs:
name: logs-enumerate-tests-${{ runner.os }}
path: |
artifacts/log/**/*.binlog
artifacts/**/*.list
artifacts/**/*tests-partitions.json
artifacts/**/*tests-metadata.json
artifacts/canonical-test-matrix.json
15 changes: 14 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ jobs:
run: >
${{ env.BUILD_SCRIPT }} -restore -ci -build -projects ${{ env.TEST_PROJECT_PATH }}
/p:PrepareForHelix=true
/bl:${{ github.workspace }}/artifacts/log/Debug/PrepareForHelix.binlog
/p:ArchiveTests=true
/bl:${{ github.workspace }}/artifacts/log/Debug/BuildAndArchive.binlog
${{ !inputs.enablePlaywrightInstall && '/p:InstallBrowsersForPlaywright=false' || '' }}
${{ inputs.versionOverrideArg }}

Expand Down Expand Up @@ -286,6 +287,12 @@ jobs:
TEST_LOG_PATH: ${{ github.workspace }}/artifacts/log/test-logs
TestsRunningOutsideOfRepo: true
TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: 'netaspireci.azurecr.io'
# PR number for CLI E2E tests that download artifacts from a PR
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
# PR head SHA for version verification (not the merge commit SHA)
GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
# GitHub token for CLI E2E tests to download artifacts
GH_TOKEN: ${{ github.token }}
run: |
# Start heartbeat monitor in background
${{ github.workspace }}/${{ env.DOTNET_SCRIPT }} ${{ github.workspace }}/tools/scripts/Heartbeat.cs &
Expand Down Expand Up @@ -324,6 +331,12 @@ jobs:
TEST_LOG_PATH: ${{ github.workspace }}/artifacts/log/test-logs
TestsRunningOutsideOfRepo: true
TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: 'netaspireci.azurecr.io'
# PR number for CLI E2E tests that download artifacts from a PR
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
# PR head SHA for version verification (not the merge commit SHA)
GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
# GitHub token for CLI E2E tests to download artifacts
GH_TOKEN: ${{ github.token }}
run: |
# Start heartbeat monitor in background (output goes to console directly)
$heartbeatProcess = Start-Process -FilePath "dotnet" `
Expand Down
Loading
Loading