-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
use --exact
on --skip
to avoid unintended substring matches
#132979
Conversation
Without the `--exact` flag, using `--skip tests/rustdoc` can unintentionally skip other tests that match as substrings such as `rustdoc-gui`, `rustdoc-js`, etc. For debugging, run: `./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc` and `./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc -- --exact` Signed-off-by: onur-ozkan <work@onurozkan.dev>
Thanks! |
use `--exact` on `--skip` to avoid unintended substring matches Without the `--exact` flag, using `--skip tests/rustdoc` can unintentionally skip other tests that match as substrings such as `rustdoc-gui`, `rustdoc-js`, etc. For debugging, run: `./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc` and `./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc -- --exact` Resolves rust-lang#117721
…llaumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#132709 (optimize char::to_digit and assert radix is at least 2) - rust-lang#132842 (ABI checks: add support for tier2 arches) - rust-lang#132965 (allow CFGuard on windows-gnullvm) - rust-lang#132967 (fix REGISTRY_USERNAME to reuse cache between auto and pr jobs) - rust-lang#132971 (Handle infer vars in anon consts on stable) - rust-lang#132979 (use `--exact` on `--skip` to avoid unintended substring matches) r? `@ghost` `@rustbot` modify labels: rollup
Hm, that might've been passed down to cg_clif?
cc @bjorn3 |
It seems that this part: rust/src/bootstrap/src/core/build_steps/test.rs Line 3408 in 65b3877
is passing all test arguments to |
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@bors try |
use `--exact` on `--skip` to avoid unintended substring matches Without the `--exact` flag, using `--skip tests/rustdoc` can unintentionally skip other tests that match as substrings such as `rustdoc-gui`, `rustdoc-js`, etc. For debugging, run: `./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc` and `./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc -- --exact` Resolves rust-lang#117721 try-job: x86_64-apple-1
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
@bors try |
use `--exact` on `--skip` to avoid unintended substring matches Without the `--exact` flag, using `--skip tests/rustdoc` can unintentionally skip other tests that match as substrings such as `rustdoc-gui`, `rustdoc-js`, etc. For debugging, run: `./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc` and `./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc -- --exact` Resolves rust-lang#117721 try-job: x86_64-apple-1
This comment has been minimized.
This comment has been minimized.
ff8ce51
to
c66da83
Compare
This comment has been minimized.
This comment has been minimized.
@rustbot author |
c66da83
to
494b83d
Compare
cargo_run.arg("--"); | ||
if builder.config.args().is_empty() { | ||
// By default, exclude tests that take longer than ~1m. | ||
cargo_run.arg("--skip-huge"); | ||
} else { | ||
cargo_run.args(builder.config.args()); | ||
if env::var("FLOAT_PARSE_TESTS_SKIP_HUGE").unwrap_or_default() == "1" { | ||
cargo_run | ||
.arg("--") | ||
// By default, exclude tests that take longer than ~1m. | ||
.arg("--skip-huge"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be missing another branch here - with the change change it looks like the tests don't run at all unless FLOAT_PARSE_TESTS_SKIP_HUGE=1
.
The logic should be: always run by default with --skip-huge
. If the user somehow indicates that slow tests should not be skipped, don't pass --skip-huge
. (So if this is done via env it should be something like FLOAT_PARSE_TESTS_NO_SKIP_HUGE
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's quite annoying not to run all tests by default and to have to pass something like NO_SKIP_HUGE
. If we don't want to run them by default, why the tool itself doesn't do it by default instead of requiring bootstrap to pass --skip-huge
? Anyway, not a big deal — I can do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reasoning is that when running the whole testsuite or in CI, about a minute of tests here is good enough. However, if it is run on its own, you probably don't want to forget to run the more thorough tests because of not passing a flag. I don't know what is best here, maybe the test should skip huge if RUSTC_BOOTSTRAP is set? (If you want to do that here it's easy enough, just set cfg.skip_huge
if the env is set).
Anyway the change looks good as-is 👍
This comment has been minimized.
This comment has been minimized.
72e1a33
to
3fe14c3
Compare
This comment has been minimized.
This comment has been minimized.
Signed-off-by: onur-ozkan <work@onurozkan.dev>
3fe14c3
to
8d404a4
Compare
@rustbot ready |
@bors r=jieyouxu,tgross35 |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#132979 (use `--exact` on `--skip` to avoid unintended substring matches) - rust-lang#133248 (CI: split x86_64-msvc-ext job) - rust-lang#133449 (std: expose `const_io_error!` as `const_error!`) - rust-lang#133453 (Commit license-metadata.json to git and check it's correct in CI) - rust-lang#133457 (miri: implement `TlsFree`) - rust-lang#133493 (do not constrain infer vars in `find_best_leaf_obligation`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#132979 - onur-ozkan:skip-exact, r=jieyouxu,tgross35 use `--exact` on `--skip` to avoid unintended substring matches Without the `--exact` flag, using `--skip tests/rustdoc` can unintentionally skip other tests that match as substrings such as `rustdoc-gui`, `rustdoc-js`, etc. For debugging, run: `./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc` and `./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc -- --exact` Resolves rust-lang#117721 try-job: x86_64-apple-1
Without the
--exact
flag, using--skip tests/rustdoc
can unintentionally skip other tests that match as substrings such asrustdoc-gui
,rustdoc-js
, etc.For debugging, run:
./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc
and./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc -- --exact
Resolves #117721
try-job: x86_64-apple-1