-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
cmd/go: add count of passing/failing tests to output #43614
Comments
What consumes this output? Is it likely tools would build upon this and expect the output to be stable and machine readable? |
Similar to #30507. |
@davecheney I'm referring to the output of go test intended for humans, not the
Similar but different. That issue was concerned with an overall fail/pass indicator. This issue is concerned with test pass/fail counts.
#41878 looks like a cool idea, but solving for a different problem to what I'm raising here. It provides functionality for customization, I don't think the problem in this issue needs customization. #41748 is also a cool idea, but is proposing printing test names at the end, and not a count summary. #27755 looks to be almost what I'm proposing. That issue was closed and locked with little discussion. In that issue @rsc states:
What I'm suggesting is not functionality to build alternate displays but additional log information that exposes information that is commonly included in the test output of similar tools into the default output. I think it is worth reconsidering that, either as #27755 proposed with counts per package, or more simply a total summary at the end, which is much more common and like how other languages test tools function. |
Would be interested in a summary of runs, passes, and failures as well. We have a project with hundreds of tests and need some form of test result summary. This is for reporting to higher-ups about the state of our products or reporting test coverages at a glance. Currently attempting to aggregate the lines of output from the test runs using PowerShell Core with the following code (Select-String is similar to grep):
From the above, |
If you're just looking for a quick workaround to find out the pass rate of a test like I was, you can use
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Ran go test.
What did you expect to see?
A count of how many tests failed or passed.
What did you see instead?
Just output about failed tests, and not how many failed or passed.
Feature request
When I'm iterating on a feature that is exploratory and involves breaking a lot of tests initially it is helpful to see progress as it is being made. When I program in Ruby I see a count of tests that pass/fail, and as I work I see the number of failing tests going down. More importantly when I'm tweaking code if I see that number jump up suddenly I know in the process of trying to fix things I have instantly broken many more things. This isn't a critical feature, but I think it would be helpful and useful because I've found that feature useful elsewhere.
I think it would be helpful if the go test output included at the end a count of the number of tests that:
I have discovered that
gotestsum
provides visibility into number of failing tests in this form:Other examples:
Ruby Rspec:
Ruby minitest:
Python unittest:
Rust:
The text was updated successfully, but these errors were encountered: