-
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
Give a better error when rustdoc tests fail #78752
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
278be9b
to
5b1bd12
Compare
It turns out there's no way to do this, since all the tests are boxed and have no way to return anything. I don't think the giant refactor would be worth it, I made delta non-interactive instead (no pager). |
I am not in the team but I would say it should be opt-out basis (on by default), for other contributors coming in they could see better error messages in the CI.
Way not take the options from
Feels like a git bisect question? Maybe we need to allow users to do a bisect? Not sure, I never did one for rust due to compilation time. |
Git diff doesn't help because these files aren't tracked by git, they're created by rustdoc. Instead I fell back to
Right, yeah I don't think it makes any sense to use bisect since it takes so long to compile things. The other rustdoc has to be pre-compiled from somewhere. Another thing I found is that if you compare to beta rustdoc the diff is very noisy, because there are unrelated changes to the files in the meantime. Maybe I should only compare HTML files and not JS? Here's an example of what I mean:
|
Ok, I think this is ready for review. |
That doesn't look like any
|
Is there any reason it shouldn't? Personally I think we should so that if there is any issue, we'll know right away.
I didn't even know about it. I think we should avoid relying on external tools if possible (or only provide it through an option).
👍
Tests are mostly to prevent regressions. So unless there is one, I'm not sure if it'd useful... I'm waiting for others' opinion there too. :) |
That's what it looks like with |
I don't have the full context here yet but in general I'm happy for delta to be used like this. It does seem like, in the absence of a Unix-ey standard for specifying ones preferred diff viewer, that the user's choice of git pager, if discernible, might be a reasonable choice. I'm happy for you to default to delta if it appears to be available. In the longer term I'll just note that there is an open issue for delta to be refactored as a Rust crate, which would give you another option for a default without worrying about the user's environment. But I'm not sure yet when that will be done! dandavison/delta#317
I didn't see this mentioned but just in case it helps there's also |
Ok, I used this to use the default git pager instead of hardcoding |
- Run the default rustdoc against the current rustdoc - Diff output recursively - Colorize diff output
- remove unused args - Fix formatting - Improve naming - Fix typo
@GuillaumeGomez is this waiting on something from me? |
Well, I was wondering about the bash script. If you want, I can make the update in a follow-up PR? Otherwise it looks good to me so if it's ready for you, r=me. |
I think this is ready to go; I moved the shell script to Rust and this uses |
@bors: r+ |
📌 Commit 25a3ffe has been approved by |
if self.config.verbose { | ||
eprintln!("using pager {}", pager); | ||
} | ||
let output = Command::new(pager) |
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.
Can pager
be like diff -u
(contain arguments)?
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, Command::new
runs it as if it were in quotes.
☀️ Test successful - checks-actions |
Don't abort rustdoc tests if `tidy` isn't installed Follow-up to rust-lang#78752. Before: ``` Check compiletest suite=rustdoc mode=rustdoc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) running 396 tests ..................................................2020-11-23T12:12:37.735649Z ERROR compiletest::runtest: fatal error, panic: "failed to run tidy - is it installed? - No such file or directory (os error 2)" F................................................. 100/396 .................................................................................................... 200/396 .................................................................................................... 300/396 ...............................i...............2020-11-23T12:15:00.271271Z ERROR compiletest::runtest: fatal error, panic: "failed to run tidy - is it installed? - No such file or directory (os error 2)" F................................................ ``` After: ``` Check compiletest suite=rustdoc mode=rustdoc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) running 4 tests .FFF failures: ---- [rustdoc] rustdoc/fn-pointer-arg-name.rs stdout ---- error: htmldocck failed! status: exit code: 1 command: "/usr/bin/python" "/home/joshua/rustc/src/etc/htmldocck.py" "/home/joshua/rustc/build/x86_64-unknown-linux-gnu/test/rustdoc/fn-pointer-arg-name" "/home/joshua/rustc/src/test/rustdoc/fn-pointer-arg-name.rs" stdout: ------------------------------------------ ------------------------------------------ stderr: ------------------------------------------ 4: `@has` check failed `XPATH PATTERN` did not match // `@has` - '//*[`@class="rust` fn"]' 'pub fn f(callback: fn(len: usize, foo: u32))' Encountered 1 errors ------------------------------------------ info: generating a diff against nightly rustdoc failed to run tidy - is it installed? - Permission denied (os error 13) failed to run tidy - is it installed? - Permission denied (os error 13) # a diff without running `tidy` ``` r? `@GuillaumeGomez`
Closes #78750.
Resolved questions
delta
? That's not a very common program to have installed, but I'm not sure how to do diffs after the fact. Maybecompiletest
can take a--syntax-highlighter
parameter or something?delta
if available anddiff --color
otherwise. It prints a warning if delta isn't installed so you know you can get nicer diffsOpen questions.
$(git merge-base HEAD origin/master)
- maybe that's feasible if we install those artifacts from CI?r? @GuillaumeGomez
cc @Mark-Simulacrum