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

Cannot silence test runner #38758

Open
phrohdoh opened this issue Jan 1, 2017 · 7 comments
Open

Cannot silence test runner #38758

phrohdoh opened this issue Jan 1, 2017 · 7 comments
Labels
A-libtest Area: `#[test]` / the `test` library C-feature-accepted Category: A feature request that has been accepted pending implementation. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@phrohdoh
Copy link

phrohdoh commented Jan 1, 2017

IRC Logs

cargo 0.17.0-nightly (740f9c0 2016-12-29)

We should be able to silence the test runner's stdout via --quiet like build and clean's --quiet flag, but alas this is not currently done.

tmba:sentinel thill $ cargo test --quiet -- quiet

running 0 tests

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


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
tmba:sentinel thill $ cargo test --quiet

running 0 tests

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


running 0 tests

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

ref: rust-lang/cargo#3482

@sfackler
Copy link
Member

sfackler commented Jan 1, 2017

--quiet prints a compact version of the normal output:

    Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
     Running /Users/sfackler/code/rust-openssl/target/debug/deps/openssl-3ace7e2ac4871275

running 146 tests
..................................................................................................................................................
test result: ok. 146 passed; 0 failed; 0 ignored; 0 measured

Seems reasonable for --quiet --quiet to completely suppress output though.

@phrohdoh
Copy link
Author

phrohdoh commented Jan 1, 2017

But --quiet doesn't even do that for me.


tmba:sentinel thill $ cargo test --quiet

running 0 tests

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


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
tmba:sentinel thill $ cargo test -- --quiet
    Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
     Running target/debug/deps/sentinel-0ecd9a282af25c50

running 0 tests

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

   Doc-tests sentinel

running 0 tests

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

@sfackler
Copy link
Member

sfackler commented Jan 1, 2017

Why doesn't it? It's displaying zero dots for the zero tests it ran.

@Mark-Simulacrum
Copy link
Member

I feel like ultimately -qq could silence test runs completely and just return the exit code; or perhaps we could have an --exit-code option that did the equivalent.

@Mark-Simulacrum Mark-Simulacrum added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label May 18, 2017
@Mark-Simulacrum Mark-Simulacrum added the A-libtest Area: `#[test]` / the `test` library label Jun 23, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-feature-request Category: A feature request, i.e: not implemented / a PR. label Jul 26, 2017
@flyingmutant
Copy link

Even with cargo test --quiet -- --quiet (!), it is excessively verbose:

$ cargo test --quiet -- --quiet

running 0 tests

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


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


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


running 0 tests

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

With --all, this output can easily span multiple pages for a reasonably sized workspace.

It would be nice to merge all the blocks instead, to eliminate the useless noise (and make --all output actually glanceable):

$ cargo test --quiet -- --quiet
running 8 tests
........
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

@dtolnay dtolnay added C-feature-accepted Category: A feature request that has been accepted pending implementation. and removed C-feature-request Category: A feature request, i.e: not implemented / a PR. labels Nov 18, 2017
@dtolnay
Copy link
Member

dtolnay commented Nov 18, 2017

I agree that an even quieter setting would be valuable. I would like to see a PR with an implementation.

In general there is a lot of room for improvement in the cargo test experience. At some point I would love for someone to reimagine how cargo test would work in an ideal world -- a bit like what has been done for error messages over the past year. It would be so wonderful if someone takes the initiative to come up with some design proposals. The RFCs repo or the users forum would be the place to follow up.

@steveklabnik
Copy link
Member

Triage: no changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-libtest Area: `#[test]` / the `test` library C-feature-accepted Category: A feature request that has been accepted pending implementation. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
Status: No status
Development

No branches or pull requests

6 participants