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: go test should be more explicit about test failures #13106

Open
pmezard opened this Issue Oct 30, 2015 · 2 comments

Comments

Projects
None yet
5 participants
@pmezard
Contributor

pmezard commented Oct 30, 2015

In the best case, the output of go test github.com/blevesearch/bleve/... is 88 lines long. If one of the early test fails, the error message can easily be scrolled out and short of looking at $? or scrolling back manually, the user has no way to know the test run failed.

I propose go test prints something visible at the end of the run in that case like:

TEST RESULT: FAILED

Having a prefix like TEST RESULT: may make it easier for tools processing test output to ignore this line in the future, should its format change (by adding the number of tests run/successful, or time it took, etc.).
A TEST RESULT: OK might be displayed on success to.

Thoughts?

@ianlancetaylor ianlancetaylor changed the title from cmd/test: go test should be more explicit about test failures to cmd/go: go test should be more explicit about test failures Oct 31, 2015

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Oct 31, 2015

@meirf

This comment has been minimized.

Member

meirf commented Jun 27, 2018

To be specific on the scope of this issue:
The case of go testing a single package already has the desired behavior: When verbose mode is not set, the output will show only failures, including FAIL at the end of the output. When verbose mode is set, even if only the first test fails, the last line of the output will show FAIL.

For go testing multiple packages, some kind of error message at the end of the output seems useful. I understand that most code would detect this by the exit status as pmezard mentions, but for humans that's not adequate. I think go testing a single package vs multiple packages is semantically the same thing in this context - one failure should cause net failure, as the exit status already establishes.

@bcmills

@agnivade

This comment has been minimized.

Member

agnivade commented Sep 30, 2018

Is the -json flag not sufficient for this ? I thought that was meant to be processed by automated tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment