Skip to content

ci: run only tests affected by pull request changes - #19654

Closed
Ankit Jain (radical) wants to merge 1 commit into
microsoft:mainfrom
radical:radical-enable-conditional-test-runs
Closed

Ankit Jain (radical) wants to merge 1 commit into
microsoft:mainfrom
radical:radical-enable-conditional-test-runs

Conversation

@radical

Copy link
Copy Markdown
Member

Description

Pull request CI currently computes a relevant test subset but still runs the full test matrix and every non-.NET test job. The selector is explicitly configured with enforce: 'false', leaving conditional test selection in audit mode.

This enables enforcement so enumerate-tests builds only selected .NET test projects and the selector gates non-.NET jobs. The run-full-ci label remains available as a kill switch that forces the complete matrix and all jobs.

A workflow contract test pins enforcement to prevent an accidental return to audit mode, and the selector design documentation now reflects the active rollout state.

Validation:

dotnet test --project tests/Infrastructure.Tests/Infrastructure.Tests.csproj --no-launch-profile -- --filter-namespace "Infrastructure.Tests.TestTriggerMap" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
Passed: 131, Failed: 0, Skipped: 0

Fixes # (issue)

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
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Pull request CI computes a relevant test subset but currently runs the full
test matrix and every non-.NET test job because the selector remains in
audit mode.

Enable enforcement so enumerate-tests builds only selected .NET test
projects and the selector gates non-.NET jobs. Keep the run-full-ci label
as a kill switch that forces complete coverage.

Add a workflow contract test that fails if tests.yml returns to audit mode,
and update the selector design documentation to reflect the active rollout.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 25, 2026 01:40
@github-actions

Copy link
Copy Markdown
Contributor

🚀 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/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19654

Or

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

@github-actions github-actions Bot added the area-engineering-systems infrastructure helix infra engineering repo stuff label Aug 25, 2026

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

Enables selective CI enforcement so pull requests run only affected tests while retaining the run-full-ci fallback.

Changes:

  • Enables test-selection enforcement in tests.yml.
  • Adds a workflow contract test protecting enforcement.
  • Updates selector documentation to reflect rollout completion.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
.github/workflows/tests.yml Enables enforced test and job selection.
tests/Infrastructure.Tests/TestTriggerMap/SelectTestsWorkflowTests.cs Verifies enforcement remains enabled.
docs/ci/test-trigger-selector-design.md Documents enforcing and audit modes.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@radical

Copy link
Copy Markdown
Member Author

[automated] Superseded by #19688, rebased as the single enablement layer above #19687 in GitHub native stack #19689.

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.

2 participants