Skip to content

Conversation

@radical
Copy link
Member

@radical radical commented Jan 10, 2026

Introduces a system to skip test categories when their source files
haven't changed in a PR, reducing CI time and resource usage.

Changes:

  • Add detect-test-scope action that analyzes changed files against
    patterns defined in test-filters.json
  • Add test-filters.json config with fallback paths (eng/, workflows)
    and category mappings (integrations, templates, cli_e2e, etc.)
  • Update tests.yml to conditionally run test jobs based on scope
  • Jobs now show as "skipped" in GitHub UI when not needed
  • Results job no longer fails on intentionally skipped jobs

Categories:

  • integrations: src/Aspire./** and tests/Aspire..Tests/**
  • templates: src/Aspire.ProjectTemplates/** and template tests
  • cli_e2e: src/Aspire.Cli/** and CLI E2E tests
  • endtoend: tests/Aspire.EndToEnd.Tests/** and playground/**
  • extension: extension/**

Fallback paths (eng/, Directory.Build.props, workflows) trigger all tests.

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

@github-actions
Copy link
Contributor

github-actions bot commented Jan 10, 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 -- 13832

Or

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

These packages are needed by the TestSelector tool to evaluate MSBuild
project properties for test selection.
MSBuild-based tool that analyzes changed files to determine which test
categories need to run. Uses dotnet-affected for NuGet dependency analysis,
glob-based path matching, project mappings, and critical file detection
to produce per-category run/skip decisions for CI.
Comprehensive test coverage for all analyzers (CriticalFileDetector,
DotNetAffected result parsing, IgnorePathFilter, NuGetDependentTestDetector,
ProjectMappingResolver, TestProjectFilter), CategoryMapper, models, and
integration tests including end-to-end evaluation and git changed files.
Defines path-to-test-category mapping rules in JSON with a JSON schema
for validation. Includes a bash validation script for scenario testing
and a README documenting the rule format.
Includes an overview document and a detailed design spec covering the
path-based test selection algorithm, category mapping, and CI integration.
Marks EndToEnd, CLI E2E, and Templates test projects with the
RequiredNuGetsForTesting MSBuild property so the TestSelector can
detect which tests need built NuGet packages.
Adds integrationsProjectsFilter input that accepts a JSON array of
specific test project paths to run, enabling the test selector to
limit integration tests to only affected projects.
Adds detect_scope job to tests.yml that runs the TestSelector tool on
PRs to determine which test categories to execute. Each test job now
conditionally runs based on scope detection output. Includes audit mode
where only templates honors conditional scope while other categories
always run. Falls back to running all tests if the selector fails.
@radical radical force-pushed the conditional-test-runs branch from df54dbf to 3731205 Compare February 1, 2026 00:09
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.

1 participant