prompt the use of --nocapture flag if cargo test process is terminated via a signal.#12463
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
03db36e to
640c4cf
Compare
|
I've split the changes into 2 commits as you asked, and changed the display string. The tests are failing right now because it is outputting the --nocapture note even if there's an exec failure. Looking into a fix for this. |
|
r? epage Hope you don't mind taking this. |
640c4cf to
6c0ab39
Compare
aa7e623 to
24fb803
Compare
|
Hi @epage need some help with this.
|
0fb2a72 to
4fffb8b
Compare
|
0633fa2 to
294a589
Compare
|
@stupendoussuperpowers could you rebase, instead of merge, so I can more easily browse the individual commits? |
1509634 to
67a0402
Compare
|
give me a day or so to work on this, really embarrassing but i'm running into multiple git issues on my local machine. will mark it ready once it's done. |
|
btw I'm hosting office hours right now but also available at other times in case you want to do a call. See https://github.com/rust-lang/cargo/wiki/Office-Hours |
|
Hmm, forgot to look back at this. @stupendoussuperpowers anything left or is this good to go? EDIT: Wow, missed your marking it as ready |
|
@bors r+ Thanks for all the work you did on this! |
|
💔 Test failed - checks-actions |
Not sure what's going on. Could be the TCP connection accidentally closed. Let's @bors retry and see. |
|
☀️ Test successful - checks-actions |
Fixes #10855
As per the discussion on this issue, we want to prompt the user to use
--nocaptureif a test is terminated abnormally. The motivation for this change is described in the issue.We check for 3 things before we display this flag. -
!is_simple(if the test ended with a non 101 status code)harness(if the standard test harness was used), and!nocapture(whether or not the--nocaptureflag was already passed to the test)There's further tests added to
test::nonzero_exit_statusthat check that thestderris correct for the various combinations possible when a test ends with a non-101 status code.The new expected behavior is -
--nocapturenote for only non-zero exit statuses, when the--nocaptureflag is not passed.--nocaptureflag.To implement the check for the
--nocaptureflag, the function definition forreport_test_errorswas changed to add thetest_args: &[&str]parameter. This parameter is passed from the immediate calling function. This private function is only called twice change and is not causing regression after making the appropriate changes to both the places it's called in.