-
Notifications
You must be signed in to change notification settings - Fork 797
Add conditional test execution based on changed files #13832
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
Draft
radical
wants to merge
9
commits into
dotnet:main
Choose a base branch
from
radical:conditional-test-runs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13832Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13832" |
3 tasks
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.
df54dbf to
3731205
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduces a system to skip test categories when their source files
haven't changed in a PR, reducing CI time and resource usage.
Changes:
patterns defined in test-filters.json
and category mappings (integrations, templates, cli_e2e, etc.)
Categories:
Fallback paths (eng/, Directory.Build.props, workflows) trigger all tests.
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com