Skip to content
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

Cargo test: redundant sections are bloating output by default #9072

Closed
ikamensh opened this issue Jan 13, 2021 · 1 comment
Closed

Cargo test: redundant sections are bloating output by default #9072

ikamensh opened this issue Jan 13, 2021 · 1 comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@ikamensh
Copy link

Describe the problem you are trying to solve
By default, cargo test can give bloated output for projects that don't have e.g. Doc-tests or other test groups.

I have a small project and have started writing first tests for it. When running cargo test, I get output:

    Finished test [unoptimized + debuginfo] target(s) in 0.02s
     Running target/debug/deps/sorts-6fd673432937221c

running 3 tests
test examine::tests::correct_not_sorted ... ok
test examine::tests::correct_sorted ... ok
test examine::tests::trivial_sorted ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/compare_sorts-06ef0930fe6c2e91

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

   Doc-tests sorts

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

The end of the output has two redundant sections that contribute no information and makes it a harder to get an idea at a glance of what has just happened (admittedly this might be less of a problem with experienced users - they know where to look).

Describe the solution you'd like
I would like either to have sections with 0 tests hidden completely, or at least reduced to single lines "Doc-tests {}: none found" or similar. Definitely not 0 count for many categories, as I must scan them all to make sure all are zero.

Notes
I recognize that this is less of an issue for experienced users that a) use selectors for the test they want to run; b) know where to look in the output. So this benefits beginners more. Streamlining the default behavior should make e.g. live demos easier on the other hand.

@ikamensh ikamensh added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jan 13, 2021
@ehuss
Copy link
Contributor

ehuss commented Jan 20, 2021

Thanks for the report! Closing as a duplicate of #4324 and #2832.

@ehuss ehuss closed this as completed Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

2 participants