bootstrap: honor suite skips for coverage modes#159079
Conversation
|
r? @jieyouxu rustbot has assigned @jieyouxu. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
cc @Zalathar in case you want to double-check the intended skipping behavior |
|
I’m somewhat nervous about trying to fix this in an ad-hoc way, as bootstrap’s path handling is already pretty tricky to reason about. From glancing at the diff, it’s hard for me to tell whether this approach is an acceptable compromise or a step in the wrong direction. I’ll try to have a closer look at what’s going on. |
No worries! Thanks for taking the time to investigate the root cause. |
|
Thanks for the PR. I think we'll go with #159131 next doors because the changes here feel too "late", in that the changes here kinda "no-op" out when the coverage test steps are already reached, whereas the changes next doors touch up the resolution to stop us reaching the coverage steps in the first place. |
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
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
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
The
Coveragestep registers both thetests/coveragesuite path and thecoverage-map/coverage-runmode aliases.During default test selection, central skip handling removes the suite path,
but leaves the mode aliases selected. As a result, these commands can still run
coverage tests:
./x test --skip=tests./x test --skip=tests/coverage./x test --skip=coverageThis change checks whether the coverage suite itself was skipped before
processing the selected coverage modes. Mode-specific skips such as
--skip=coverage-mapand--skip=coverage-runretain their existing behavior.Regression tests cover both suite-level and mode-specific skip paths.
Tested with: