-
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
Add option to run all tests #53527
Add option to run all tests #53527
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
I don't know if "--all" is such a good name when we also have flags for "--tests" and "--benches", but I'm pulling blank on alternatives. I'm thinking it should be ok because the most common usage would be |
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.
A few minor nits, but otherwise this looks good.
src/libtest/lib.rs
Outdated
@@ -544,7 +552,11 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> { | |||
None | |||
}; | |||
|
|||
let run_ignored = matches.opt_present("ignored"); | |||
let run_ignored = match (matches.opt_present("all"), matches.opt_present("ignored")) { | |||
(true, _) => RunIgnored::Yes, |
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 wonder if it makes sense to error here if we've been passed both; what do you think?
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.
Hmm, maybe. It's often better for humans but worse for automated tools. It's also the more conservative approach that we can always relax later so I'm going for it.
src/libtest/lib.rs
Outdated
@@ -1869,7 +1887,21 @@ mod tests { | |||
Some(Ok(o)) => o, | |||
_ => panic!("Malformed arg in parse_ignored_flag"), | |||
}; | |||
assert!((opts.run_ignored)); | |||
assert!((opts.run_ignored == RunIgnored::Only)); |
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.
assert_eq and needless inner parentheses
src/libtest/lib.rs
Outdated
]; | ||
let opts = match parse_opts(&args) { | ||
Some(Ok(o)) => o, | ||
_ => panic!("Malformed arg in parse_ignored_flag"), |
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.
No need for this panic, we can probably just unwrap?
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.
Yeah. Also, I think this is an error message for a buggy test, not a buggy parse_opts.
@rust-lang/libs - as an insta-stable change asking for FCP (I don't think I can start it). Cc @rust-lang/dev-tools, not sure if this is under your purview... |
libtest is semi-private / permanently unstable (except possibly for |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
same behaviour, just shorter
add --all flag to libtest that runs ignored and not ignored tests
@djrenren on devtools is working on custom test frameworks and probably should have a say on this |
This looks really helpful. Two nits:
|
I associate
What does that mean in this context? |
Presumably ignored tests are ignored for a reason. You're explicitly going against the intentions of the author so to me it seems worth of a
Ah @Mark-Simulacrum mentioned making this an insta-stable change rather than starting as nightly-only then stabilizing later. |
If the author didn't want it to be run ever it would be deleted, commented out or not marked There's an unstable options flag that supposedly only allows the nightly compiler to use certain flags, but it seems like it really just enforces passing |
It isn’t great that the subtly different commands |
I was thinking something like |
Seems like a nice thing to have from my perspective. I agree |
|
What's the procedure for moving forward? I can't think think of any better flag names than the ones I've proposed so far. |
I'm going to reassign to r? @nrc since I think the dev tools team is where the decision needs to come from at this point |
⌛ Testing commit f6f3228 with merge e6ec19172a3119598e81f83d9f9a962f78c92c06... |
💔 Test failed - status-appveyor |
This has broken a dependency
|
@kennytm So that's an external crate that calls into rustc internals? I'm a bit confused on what I should do now. |
You'll probably want to just retry the build in a few days at which point this should land since we don't require clippy to pass normally, just before and during release week. Once this lands compiletest on crates.io can be updated and finally clippy update can land (or just Cargo.lock, perhaps). |
@bors retry |
Add option to run all tests This adds the "--include-ignored" flag to libtest, which allows running ignored and unignored tests in one go. Closes #50363
☀️ Test successful - status-appveyor, status-travis |
📣 Toolstate changed by #53527! Tested on commit 9f53c87. 💔 clippy-driver on windows: test-pass → test-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra). |
Tested on commit rust-lang/rust@9f53c87. Direct link to PR: <rust-lang/rust#53527> 💔 clippy-driver on windows: test-pass → test-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra). 💔 clippy-driver on linux: test-pass → test-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
In the interest of saving time, and breaking as little as possible, I'll add a EDIT: oh we don't own |
So I think we should try to do this without breaking |
@eddyb Have the waters calmed enough that this can be merged again? Should I open a new PR? |
@Emerentius Yes, sorry to delay this and keep you waiting! RC1 went out about a week ago. |
This adds the "--include-ignored" flag to libtest, which allows running ignored and unignored tests in one go.
Closes #50363