-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix rustdoc gui tester #112962
Fix rustdoc gui tester #112962
Conversation
Failed to set assignee to
|
r? @ozkanonur |
try_run(&mut cargo, config.verbose); | ||
if !try_run(&mut cargo, config.verbose) { |
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.
Looking at cause if this bug, i want to slap must_use
over try_run
and find all similar places.
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.
That's a good idea. Doing that shortly.
@@ -158,5 +161,5 @@ If you want to install the `browser-ui-test` dependency, run `npm install browse | |||
|
|||
command.args(&config.test_args); | |||
|
|||
try_run(&mut command, config.verbose); | |||
if try_run(&mut command, config.verbose) { Ok(()) } else { Err(()) } |
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.
What about using assert!
with a simple error message on all try_run
usages?
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 error message would be less good because of the panic. I think try_run
should return a Result
instead of a boolean. Impossible to ignore it this way.
r=me with adding |
Like I said above, instead of relying on |
0fd01a4
to
9a78945
Compare
I thought you wouldn't want to do it in this PR. This is even better. Thanks a lot! Will queue the PR once CI is green |
This comment has been minimized.
This comment has been minimized.
9a78945
to
7b55779
Compare
@bors r+ rollup |
…ter, r=ozkanonur Fix rustdoc gui tester Problem was that the `main` was always exiting with `0`, whether or not there was an error. It led to failing GUI tests being ignored in the CI since no one saw them. r? `@klensy`
…ter, r=ozkanonur Fix rustdoc gui tester Problem was that the `main` was always exiting with `0`, whether or not there was an error. It led to failing GUI tests being ignored in the CI since no one saw them. r? ``@klensy``
…ter, r=ozkanonur Fix rustdoc gui tester Problem was that the `main` was always exiting with `0`, whether or not there was an error. It led to failing GUI tests being ignored in the CI since no one saw them. r? ```@klensy```
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#112616 (Improve tests on targets without unwinding) - rust-lang#112643 (Always register sized obligation for argument) - rust-lang#112740 (Add link to rustdoc book search chapter in help popover) - rust-lang#112810 (Don't ICE on unnormalized struct tail in layout computation) - rust-lang#112870 (Migrate `item_bounds` to `ty::Clause`) - rust-lang#112925 (Stop hiding const eval limit in external macros) - rust-lang#112960 ([tests/rustdoc] Add `@files` command) - rust-lang#112962 (Fix rustdoc gui tester) r? `@ghost` `@rustbot` modify labels: rollup
fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> bool { | ||
fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> Result<(), ()> { | ||
if !builder.fail_fast { | ||
if !builder.try_run(cmd) { | ||
if let Err(e) = builder.try_run(cmd) { | ||
let mut failures = builder.delayed_failures.borrow_mut(); | ||
failures.push(format!("{:?}", cmd)); | ||
return false; | ||
return Err(e); | ||
} | ||
} else { | ||
builder.run(cmd); | ||
} | ||
true | ||
Ok(()) |
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.
this function should not have changed. now fail_fast
is broken because anything calling try_run
will panic immediately instead of waiting for all other steps to finish running.
fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> Result<(), ()> { | ||
if !builder.fail_fast { | ||
if !builder.try_run(cmd) { | ||
if let Err(e) = builder.try_run(cmd) { | ||
let mut failures = builder.delayed_failures.borrow_mut(); | ||
failures.push(format!("{:?}", cmd)); | ||
return false; | ||
return Err(e); | ||
} | ||
} else { | ||
builder.run(cmd); | ||
} | ||
true | ||
Ok(()) |
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.
this also doesn't look right and no longer respects fail_fast
.
…nur,jyn514 Don't fail early if `try_run` returns an error Fixes rust-lang#113208. Follow-up of rust-lang#112962. r? `@jyn514`
Problem was that the
main
was always exiting with0
, whether or not there was an error. It led to failing GUI tests being ignored in the CI since no one saw them.r? @klensy