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

[workspace - test] cargo test should output a summary after running all tests in a workspace #8414

Closed
robinmoussu opened this issue Jun 26, 2020 · 4 comments
Labels
A-workspaces Area: workspaces C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-test S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

Comments

@robinmoussu
Copy link
Contributor

Describe the problem you are trying to solve

In a "standard" crate, if you run cargo test, and everything is good, you can look at the last line of the output. In a crate that uses workspace, the output is much more messy, since each sub-crate will report their status, and you can't see immediately if everything went fine.

Describe the solution you'd like

In addition to the current output, if the current crate uses workspace, a global summary should be added at the end of the logs. Something like:

   Summary (in green)

test result: ok. 54 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
@robinmoussu robinmoussu added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jun 26, 2020
@ehuss ehuss added A-workspaces Area: workspaces Command-test labels Jul 4, 2020
@avl
Copy link

avl commented Aug 4, 2020

This would be very nice. I have a largish project at work with a lot of crates. I just realized I've had a bug on a working branch, detected by tests for several days, without realizing. The failing tests simply scrolled past too fast for me to be able to read see it. The last tested crates succeeded, meaning the last screenful contained no hint at all of any failing tests.

@FredTheDino
Copy link

Gonna go ahead and bump this! I've had similar problems to avl, not to mention that the output is quite noisy.

I took a quick look at the source, and this looks like a hard feature to implement. Since it looked like each sub-crate was compiled and run individually. This lead me to the conclusion that the easiest way might be to do a cargo-plugin that parses the output from cargo test.

I'm in a fixing mood and might just go ahead and write this thing - unless someone else sees an easier or better way?

@weihanglo weihanglo added the S-triage Status: This issue is waiting on initial triage. label May 15, 2023
@weihanglo
Copy link
Member

From #11945 (comment):

Feel like this is also blocked on libtest's JSON output. Cargo needs a reliable way to collect such data. See #11875 (comment) for more. In the meantime, personally I'd recommend nextest, which has a handful of goodies for testing user experience.

@weihanglo weihanglo added S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix and removed S-triage Status: This issue is waiting on initial triage. labels Jun 2, 2023
@epage
Copy link
Contributor

epage commented Jun 2, 2023

This reads like its a duplicate of #4324, closing in favor of that. If there is a reason we need a unique issue for this, let us know!

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-workspaces Area: workspaces C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-test S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix
Projects
None yet
Development

No branches or pull requests

6 participants