Skip to content
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

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

onur-ozkan
Copy link
Member

@onur-ozkan onur-ozkan commented Nov 13, 2024

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 #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 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>
@rustbot
Copy link
Collaborator

rustbot commented Nov 13, 2024

r? @Kobzol

rustbot has assigned @Kobzol.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added 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-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Nov 13, 2024
@jieyouxu
Copy link
Member

Thanks!
r? jieyouxu
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 13, 2024

📌 Commit 13d59ec has been approved by jieyouxu

It is now in the queue for this repository.

@rustbot rustbot assigned jieyouxu and unassigned Kobzol Nov 13, 2024
@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 13, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 13, 2024
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
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 13, 2024
…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
@GuillaumeGomez
Copy link
Member

Failed in #132989.

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 13, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Nov 13, 2024

Unknown flag --exact
The build system of cg_clif.

USAGE:
    ./y.sh prepare [--out-dir DIR] [--download-dir DIR]
    ./y.sh build [--sysroot none|clif|llvm] [--out-dir DIR] [--download-dir DIR] [--no-unstable-features] [--frozen]
    ./y.sh test [--sysroot none|clif|llvm] [--out-dir DIR] [--download-dir DIR] [--no-unstable-features] [--frozen] [--skip-test TESTNAME]
    ./y.sh abi-cafe [--sysroot none|clif|llvm] [--out-dir DIR] [--download-dir DIR] [--no-unstable-features] [--frozen]
    ./y.sh bench [--sysroot none|clif|llvm] [--out-dir DIR] [--download-dir DIR] [--no-unstable-features] [--frozen]
OPTIONS:

Hm, that might've been passed down to cg_clif?

/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-codegen/x86_64-apple-darwin/release/y test --download-dir /Users/runner/work/rust/rust/build/cg_clif_download --out-dir /Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif --no-unstable-features --use-backend cranelift --sysroot llvm --skip-test testsuite.extended_sysroot --exact

cc @bjorn3

@onur-ozkan
Copy link
Member Author

It seems that this part:

cargo.args(builder.config.test_args());

is passing all test arguments to cg_clif which doesn't seem right as we can't know if they are supported or not. We should only pass specific arguments explicitly.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Nov 13, 2024
@onur-ozkan
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Nov 13, 2024

⌛ Trying commit 1824c7f with merge 8675613...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 13, 2024
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
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 13, 2024

💔 Test failed - checks-actions

@onur-ozkan
Copy link
Member Author

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 13, 2024
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
@bors
Copy link
Contributor

bors commented Nov 13, 2024

⌛ Trying commit 11dca9e with merge 505cd65...

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 25, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@onur-ozkan
Copy link
Member Author

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 25, 2024
Comment on lines 3603 to 3606
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");
Copy link
Contributor

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).

Copy link
Member Author

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.

Copy link
Contributor

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 👍

@rust-log-analyzer

This comment has been minimized.

@onur-ozkan onur-ozkan force-pushed the skip-exact branch 2 times, most recently from 72e1a33 to 3fe14c3 Compare November 26, 2024 19:00
@rust-log-analyzer

This comment has been minimized.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 26, 2024
@onur-ozkan
Copy link
Member Author

@bors r=jieyouxu,tgross35

@bors
Copy link
Contributor

bors commented Nov 27, 2024

📌 Commit 8d404a4 has been approved by jieyouxu,tgross35

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 27, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 27, 2024
…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
@bors bors merged commit ee2d862 into rust-lang:master Nov 27, 2024
6 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Nov 27, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 27, 2024
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
@onur-ozkan onur-ozkan deleted the skip-exact branch November 27, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Some tests are incorrectly skipped for macOS CI
9 participants