Skip to content

[release/13.2][CI] Use large runner for Aspire.Hosting.Tests#15016

Merged
radical merged 5 commits intorelease/13.2from
custom-runners
Mar 6, 2026
Merged

[release/13.2][CI] Use large runner for Aspire.Hosting.Tests#15016
radical merged 5 commits intorelease/13.2from
custom-runners

Conversation

@radical
Copy link
Member

@radical radical commented Mar 6, 2026

Description

Adds per-OS custom GitHub Actions runner support to the test matrix and uses it to run Aspire.Hosting.Tests on an 8-core Ubuntu runner for faster CI.

Changes:

  1. Per-OS custom runner support — Test projects can now override GitHub Actions runners per OS via MSBuild properties (GithubActionsRunnerWindows, GithubActionsRunnerLinux, GithubActionsRunnerMacOS). Custom runners flow through metadata JSON → canonical matrix → GitHub expansion, falling back to defaults when unset.

  2. runner.os instead of inputs.osrun-tests.yml now uses runner.os (Linux/Windows/macOS) instead of matching against hardcoded runner names like ubuntu-latest. This is necessary for custom runners to work correctly.

  3. 8-core runner for Aspire.Hosting.Tests — Configures Aspire.Hosting.Tests to run on 8-core-ubuntu-latest on Linux for faster test execution.

  4. 8-core runner for Linux CLI build — Upgrades the Linux CLI archive build runner from ubuntu-latest to 8-core-ubuntu-latest.

Includes unit tests for the runner passthrough in BuildTestMatrixTests.cs and ExpandTestMatrixGitHubTests.cs, and updates docs/ci/TestingOnCI.md with documentation for the new MSBuild properties.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No

Copilot AI review requested due to automatic review settings March 6, 2026 18:14
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15016

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15016"

Copy link
Contributor

Copilot AI left a comment

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 enhances the CI test matrix pipeline to support per-OS custom GitHub Actions runners (flowing from MSBuild → metadata JSON → canonical matrix → GitHub expansion), and updates run-tests.yml to use runner.os for OS detection so custom runner names don’t break conditional logic.

Changes:

  • Add optional runners passthrough in test metadata/canonical matrix and apply OS-specific runs-on overrides during GitHub matrix expansion.
  • Switch OS detection in run-tests.yml from inputs.os runner-name matching to runner.os (Linux/Windows/macOS).
  • Use 8-core-ubuntu-latest for the Linux CLI native archive build job.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/Infrastructure.Tests/Shared/TestDataBuilder.cs Extends test metadata and canonical matrix test helpers to include optional runners.
tests/Infrastructure.Tests/PowerShellScripts/BuildTestMatrixTests.cs Adds coverage ensuring runners is preserved/omitted correctly in canonical matrix generation.
tests/Infrastructure.Tests/PowerShellScripts/ExpandTestMatrixGitHubTests.cs Adds coverage ensuring OS-specific runs-on uses custom runners where configured.
eng/scripts/build-test-matrix.ps1 Passes runners through from metadata into canonical matrix entries (regular + split entries).
eng/scripts/expand-test-matrix-github.ps1 Applies OS-specific custom runner override when expanding to GitHub matrix entries.
eng/Testing.targets Documents new MSBuild properties for per-OS GitHub runner overrides.
eng/TestEnumerationRunsheetBuilder/TestEnumerationRunsheetBuilder.targets Emits optional runners object into .tests-metadata.json when overrides are configured.
docs/ci/TestingOnCI.md Documents the new runners metadata and how to configure custom runners in projects.
.github/workflows/run-tests.yml Uses runner.os for OS-based branching instead of matching runner name strings.
.github/workflows/build-cli-native-archives.yml Switches Linux CLI archive build to 8-core-ubuntu-latest.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

🎬 CLI E2E Test Recordings

The following terminal recordings are available for commit a2be062:

Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CreateAndDeployToDockerCompose ▶️ View Recording
CreateAndDeployToDockerComposeInteractive ▶️ View Recording
CreateAndPublishToKubernetes ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateEmptyAppHostProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateStartWaitAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording
TypeScriptAppHostWithProjectReferenceIntegration ▶️ View Recording

📹 Recordings uploaded automatically from CI run #22781553382

@radical radical requested a review from mitchdenny as a code owner March 6, 2026 20:38
@radical radical marked this pull request as draft March 6, 2026 20:39
radical and others added 4 commits March 6, 2026 15:39
Allow test projects to override GitHub Actions runners per OS via
MSBuild properties (GithubActionsRunnerWindows/Linux/MacOS). The
custom runners flow through metadata JSON → canonical matrix → GitHub
expansion, falling back to defaults when unset.

Also switch run-tests.yml OS detection from inputs.os string matching
to runner.os, which works correctly with non-standard runner names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@radical radical changed the title Add per-OS custom GitHub runner support and use runner.os for OS detection [release/13.2][CI] Use large runner for Aspire.Hosting.Tests Mar 6, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@radical radical marked this pull request as ready for review March 6, 2026 20:59
@radical radical added the area-engineering-systems infrastructure helix infra engineering repo stuff label Mar 6, 2026
@radical radical added this to the 13.2 milestone Mar 6, 2026
@radical radical merged commit 09b3cc0 into release/13.2 Mar 6, 2026
760 of 763 checks passed
@radical radical deleted the custom-runners branch March 6, 2026 21:40
@dotnet-policy-service dotnet-policy-service bot modified the milestone: 13.2 Mar 6, 2026
eerhardt pushed a commit to eerhardt/aspire that referenced this pull request Mar 7, 2026
…ft#15016)

* Add per-OS custom GitHub runner support to test matrix

Allow test projects to override GitHub Actions runners per OS via
MSBuild properties (GithubActionsRunnerWindows/Linux/MacOS). The
custom runners flow through metadata JSON → canonical matrix → GitHub
expansion, falling back to defaults when unset.

Also switch run-tests.yml OS detection from inputs.os string matching
to runner.os, which works correctly with non-standard runner names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* build cli with 8core

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Use 8-core Ubuntu runner for Aspire.Hosting.Tests in CI

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix IDE2000: remove multiple blank lines

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI pushed a commit that referenced this pull request Mar 10, 2026
* Add per-OS custom GitHub runner support to test matrix

Allow test projects to override GitHub Actions runners per OS via
MSBuild properties (GithubActionsRunnerWindows/Linux/MacOS). The
custom runners flow through metadata JSON → canonical matrix → GitHub
expansion, falling back to defaults when unset.

Also switch run-tests.yml OS detection from inputs.os string matching
to runner.os, which works correctly with non-standard runner names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* build cli with 8core

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Use 8-core Ubuntu runner for Aspire.Hosting.Tests in CI

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix IDE2000: remove multiple blank lines

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-engineering-systems infrastructure helix infra engineering repo stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants