bootstrap: Allow path-based skipping of the coverage test suite#159131
Conversation
|
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 |
This comment has been minimized.
This comment has been minimized.
bootstrap: Allow path-based skipping of the coverage test suite try-job: x86_64-msvc-2 try-job: x86_64-gnu-llvm-22-1
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
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.
|
I think there's some conceptual overlap with #154571, which was another case where we want to skip a step if any of its paths are skipped. The approach used by this PR doesn't help in that case (since suites aren't involved), but it's worth keeping both in mind when we do make deeper changes to how skipping works. |
There was a problem hiding this comment.
I can't say I'm a huge fan of adding more hacks to ShouldRun, but I do still feel this is better than having to skip coverage-{run,map} specifically in CI and elsewhere. (And also the path/filter handling is a larger topic not for this PR.)
Thanks
@bors r+
bootstrap: Allow path-based skipping of the coverage test suite - Alternative to rust-lang#159079 --- 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 PR 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
bootstrap: Allow path-based skipping of the coverage test suite - Alternative to rust-lang#159079 --- 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 PR 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
…uwer Rollup of 7 pull requests Successful merges: - #158732 (Apply MCP 1003 and move diagnostics.rs into its own module) - #159010 (Simplify the unwind crate) - #159131 (bootstrap: Allow path-based skipping of the coverage test suite) - #159134 (std: fix panic in Windows Stdin::read_vectored with pending surrogate) - #159178 (Print duration of BOLT instrumentation and optimization steps) - #159112 (Fix segfault in env access in statically linked FreeBSD binaries) - #159124 (compiletest: use VecDeque::pop_front_if)
…uwer Rollup of 6 pull requests Successful merges: - #158732 (Apply MCP 1003 and move diagnostics.rs into its own module) - #159131 (bootstrap: Allow path-based skipping of the coverage test suite) - #159134 (std: fix panic in Windows Stdin::read_vectored with pending surrogate) - #159178 (Print duration of BOLT instrumentation and optimization steps) - #159112 (Fix segfault in env access in statically linked FreeBSD binaries) - #159124 (compiletest: use VecDeque::pop_front_if)
Rollup merge of #159131 - Zalathar:skip-coverage, r=jieyouxu bootstrap: Allow path-based skipping of the coverage test suite - Alternative to #159079 --- 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 PR 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
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=testsor./x test --skip=coverageshould skip the coverage tests, but instead the coverage tests would run anyway, due to thecoverage-mapandcoverage-runaliases being treated as implied command-line arguments.This PR 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 thedefault_to_suites_onlyflag, 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=testsshould now skip the coverage tests, as intended. This lets us remove some--skiparguments from CI scripts, which were only required by the previous incorrect behaviour.The
default_to_suites_onlyflag 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--skiparguments from CI scripts makes this a net positive.r? jieyouxu