Skip to content

bootstrap: Allow path-based skipping of the coverage test suite#159131

Open
Zalathar wants to merge 3 commits into
rust-lang:mainfrom
Zalathar:skip-coverage
Open

bootstrap: Allow path-based skipping of the coverage test suite#159131
Zalathar wants to merge 3 commits into
rust-lang:mainfrom
Zalathar:skip-coverage

Conversation

@Zalathar

Copy link
Copy Markdown
Member

When bootstrap runs a step by default, without explicit paths, it will normally act as though the user had explicitly requested all of the paths and aliases that the step registered through ShouldRun.

For the coverage test suite, that gives the wrong outcome. Running a command like ./x test --skip=tests or ./x test --skip=coverage should skip the coverage tests, but instead the coverage tests would run anyway, due to the coverage-map and coverage-run aliases being treated as implied command-line arguments.

This commit fixes that problem by adding a special flag to ShouldRun. When creating pathsets for a step that is being run by default, if the step has set the default_to_suites_only flag, all non-suite pathsets are discarded. That gives the desired behaviour for skipping coverage tests, without affecting other steps, since other steps don't set the flag.

The end result is that ./x test --skip=tests should now skip the coverage tests, as intended. This lets us remove some --skip arguments from CI scripts, which were only required by the previous incorrect behaviour.


The default_to_suites_only flag is a bit of a hack, but to me it seems like the cleanest way to resolve this problem without having to completely overhaul how CLI paths work, which is a much bigger task. And I think being able to remove the weird extra --skip arguments from CI scripts makes this a net positive.

r? jieyouxu

Zalathar added 3 commits July 11, 2026 21:09
When bootstrap runs a step by default, without explicit paths, it will normally
act as though the user had explicitly requested all of the paths and aliases
that the step registered through `ShouldRun`.

For the coverage test suite, that gives the wrong outcome. Running a command
like `./x test --skip=tests` or `./x test --skip=coverage` should skip the
coverage tests, but instead the coverage tests would run anyway, due to the
`coverage-map` and `coverage-run` aliases being treated as implied command-line
arguments.

This commit fixes that problem by adding a special flag to `ShouldRun`. When
creating pathsets for a step that is being run by default, if the step has set
the `default_to_suites_only` flag, all non-suite pathsets are discarded. That
gives the desired behavior for skipping coverage tests, without affecting other
steps, since other steps don't set the flag.
@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jul 11, 2026
@Zalathar

Copy link
Copy Markdown
Member Author

Running a few try jobs to double-check that coverage jobs are still skipped in the appropriate CI jobs:

@bors try jobs=x86_64-msvc-2,x86_64-gnu-llvm-22-1

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 11, 2026
bootstrap: Allow path-based skipping of the coverage test suite


try-job: x86_64-msvc-2
try-job: x86_64-gnu-llvm-22-1
@rust-bors

rust-bors Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 6bcad16 (6bcad167e4ed6a807b18096e765a3d0ac0979ccd)
Base parent: 3b58636 (3b58636b30eb364ac72aeaf03d46347084ed87d1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants