-
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
rustdoc: fix 98690 Panic if invalid path for -Z persist-doctests #98708
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @CraftSpider (or someone else) soon. Please see the contribution instructions for more information. |
Can you add a |
Hum actually, I'm not sure if it's possible to check this one in CI... Maybe you have an idea @notriddle @camelid ? |
Yeah I tried to find CLI tests but there didn't seem anything to plug into.. would have to come up with something I think on another PR? My first PR sorry.. 🦄 |
Don't worry, if it requires developing something new, we will just approve this PR and do it in another PR. I'm just checking I didn't miss something. |
I tried to add in src/test/rustdoc/isue-98690.rs - however CI has access to / so I am wondering how I can simulate invalid path here as std::fs::create_dir_all(&path) on ubuntu-latest is very forgiving that regard // compile-flags: --persist-doctests /cannot_write_here -Z unstable-options
#![crate_name = "foo"]
//! ```
//! use foo::dummy;
//! dummy();
//! ``` I am not even sure if the above would catch runtime panic and I cannot check the result of eprintln or not sure about negative tests However it does catch non-panic exit(1) code say if I would have invalid arguments e.g. adding extra -hfff to cli:
The test failures on that fn were relying on the same method I was using to roll exit so I followed that without using exit codes |
Oh that's because you need to put it into |
Ah that's helpful.. I think /../../ will work in CI to simulate invalid path:
rust/src/test/rustdoc-ui$ cat issue-68690.stderr
I updated stderr but it is expecting exit status code 1 if I intepret the above correct However this would be different to rest of the test errors if I just exit the whole program Is there a way to put exit code 101 into test data as expected exit condition or should I exit with 1 code ? EDIT: // failure-status: 101 - gotcha! |
Added a test :) this will now test for the error out - Thanks for the help 💜 @GuillaumeGomez |
953dd03
to
29e0e14
Compare
I didn't even have time to answer you. Great work and thanks a lot for this! (It allowed me to discover few things on the tests too 😆 ) @bors r+ rollup |
📌 Commit 29e0e14 has been approved by |
…llaumeGomez rustdoc: fix 98690 Panic if invalid path for -Z persist-doctests Closes rust-lang#98690 for rustdoc panic I changed this to do eprintln and orderly panic instead of unwrap doing unhandled panic ~/gg/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc --test -Z unstable-options --persist-doctests /tmp/foobar main.rs Couldn't create directory for doctest executables: Permission denied (os error 13)
…llaumeGomez rustdoc: fix 98690 Panic if invalid path for -Z persist-doctests Closes rust-lang#98690 for rustdoc panic I changed this to do eprintln and orderly panic instead of unwrap doing unhandled panic ~/gg/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc --test -Z unstable-options --persist-doctests /tmp/foobar main.rs Couldn't create directory for doctest executables: Permission denied (os error 13)
Let's go again! @bors r+ rollup |
📌 Commit 29e0e14 has been approved by |
…llaumeGomez rustdoc: fix 98690 Panic if invalid path for -Z persist-doctests Closes rust-lang#98690 for rustdoc panic I changed this to do eprintln and orderly panic instead of unwrap doing unhandled panic ~/gg/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc --test -Z unstable-options --persist-doctests /tmp/foobar main.rs Couldn't create directory for doctest executables: Permission denied (os error 13)
@bors r- Failed in rollup #98744 No idea why the test harness comment failed. only-linux should have worked. |
The only other test that has only-windows it's the first header I tried to briefly look for reason why it gets ignored from here: It doesn't seem (by reading fn header_iter) that header placement should have any issue though |
Ok it looks like rollup picked up the wrong commit thanks @ehuss and @jyn514 for the help EDIT: Bors picked up the wrong commit for reason or another |
@bors r=GuillaumeGomez rollup |
📌 Commit 6565509 has been approved by |
…laumeGomez Rollup of 5 pull requests Successful merges: - rust-lang#97249 (`<details>`/`<summary>` UI fixes) - rust-lang#98418 (Allow macOS to build LLVM as shared library) - rust-lang#98460 (Use CSS variables to handle theming) - rust-lang#98497 (Improve some inference diagnostics) - rust-lang#98708 (rustdoc: fix 98690 Panic if invalid path for -Z persist-doctests) Failed merges: - rust-lang#98761 (more `need_type_info` improvements) r? `@ghost` `@rustbot` modify labels: rollup
Will this test fail if tested with root ? |
Do you have an example in mind? |
That sounds like the expected behaviour, no? |
Closes #98690 for rustdoc panic
I changed this to do eprintln and orderly panic instead of unwrap doing unhandled panic
~/gg/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc --test -Z unstable-options --persist-doctests /tmp/foobar main.rs
Couldn't create directory for doctest executables: Permission denied (os error 13)