-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Show test type during prints #84863
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
Show test type during prints #84863
Conversation
r? @kennytm (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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 like this change. But for regular #[test]
s the output looks a bit messy, since there's nothing that visually separates the test name from the test type:
running 4 tests
test hello ignore ... ignored
test hey should panic ... ok
test hi run ... ok
test hi2 run ... ok
Maybe it should be in parenthesis? Or preceded by -
or :
?
(E.g.
running 4 tests
test hello - ignore ... ignored
test hey - should panic ... ok
test hi - run ... ok
test hi2 - run ... ok
)
What do you think?
I think |
Concerning the failing CI, I am not sure where it came from. Correct me if I am wrong but I think the problem is that it tries to build the library at stage 0 (so with the beta compiler) but it does not have the change of the #[test] macro so fail to build test function. |
This comment has been minimized.
This comment has been minimized.
Indeed. Everything You can use |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I remove the redundant print for run and ignore. Let me know if I need to change something else 😄. |
This comment has been minimized.
This comment has been minimized.
🔔 This is now entering its final comment period, as per the review above. 🔔 |
I would prefer to keep it short. Just wondering what happens if the test name is too long and overflow an 80 characters terminal? Wouldn't that be ugly? Or is there some truncation mechanism? |
I don't think there is a truncation mechanism. |
I think once this issue is merged we need to add a truncation mechanism, because with the addition of |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
Thanks again! @bors r+ |
📌 Commit 6de13c3 has been approved by |
Show test type during prints Test output can sometimes be confusing. For example doctest with the no_run argument are displayed the same way than test that are run. During rust-lang#83857 I got the feedback that test output can be confusing. For the moment test output is ``` test $DIR/test-type.rs - f (line 12) ... ignored test $DIR/test-type.rs - f (line 15) ... ok test $DIR/test-type.rs - f (line 21) ... ok test $DIR/test-type.rs - f (line 6) ... ok ``` I propose to change output by indicating the test type as ``` test $DIR/test-type.rs - f (line 12) ... ignored test $DIR/test-type.rs - f (line 15) - compile ... ok test $DIR/test-type.rs - f (line 21) - compile fail ... ok test $DIR/test-type.rs - f (line 6) ... ok ``` by indicating the test type after the test name (and in the case of doctest after the function name and line) and before the "...". ------------ Note: this is a proof of concept, the implementation is probably not optimal as the properties added in `TestDesc` are only use in the display and does not represent actual change of behavior, maybe `TestType::DocTest` could have fields
Show test type during prints Test output can sometimes be confusing. For example doctest with the no_run argument are displayed the same way than test that are run. During rust-lang#83857 I got the feedback that test output can be confusing. For the moment test output is ``` test $DIR/test-type.rs - f (line 12) ... ignored test $DIR/test-type.rs - f (line 15) ... ok test $DIR/test-type.rs - f (line 21) ... ok test $DIR/test-type.rs - f (line 6) ... ok ``` I propose to change output by indicating the test type as ``` test $DIR/test-type.rs - f (line 12) ... ignored test $DIR/test-type.rs - f (line 15) - compile ... ok test $DIR/test-type.rs - f (line 21) - compile fail ... ok test $DIR/test-type.rs - f (line 6) ... ok ``` by indicating the test type after the test name (and in the case of doctest after the function name and line) and before the "...". ------------ Note: this is a proof of concept, the implementation is probably not optimal as the properties added in `TestDesc` are only use in the display and does not represent actual change of behavior, maybe `TestType::DocTest` could have fields
☀️ Test successful - checks-actions |
Update `cargo-miri` tests The test output has been changed recently (likely by rust-lang/rust#84863) and caused a test failure: https://github.com/rust-lang/miri/runs/2761591139#step:8:1228
Test output can sometimes be confusing. For example doctest with the no_run argument are displayed the same way than test that are run.
During #83857 I got the feedback that test output can be confusing.
For the moment test output is
I propose to change output by indicating the test type as
by indicating the test type after the test name (and in the case of doctest after the function name and line) and before the "...".
Note: this is a proof of concept, the implementation is probably not optimal as the properties added in
TestDesc
are only use in the display and does not represent actual change of behavior, maybeTestType::DocTest
could have fields