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

proposal: cmd/go: go test summary #27755

Closed
cn007b opened this issue Sep 19, 2018 · 4 comments
Closed

proposal: cmd/go: go test summary #27755

cn007b opened this issue Sep 19, 2018 · 4 comments

Comments

@cn007b
Copy link
Contributor

cn007b commented Sep 19, 2018

Does it make sense to have summary for go test and receive information like:

PASS
ok  	firstapp	0.006s    Total 10 test cases, failed 2, skipped 1, success 7.

What version of Go are you using (go version)?

go version go1.11 darwin/amd64

What did you do?

go test

What did you expect to see?

PASS
ok  	firstapp	0.006s    Total 10 test cases, failed 2, skipped 1, success 7.

What did you see instead?

PASS
ok  	firstapp	0.006s
@gopherbot gopherbot added this to the Proposal milestone Sep 19, 2018
@ALTree ALTree changed the title Proposal: go test summary proposal: go test summary Sep 19, 2018
@ALTree ALTree changed the title proposal: go test summary proposal: cmd/go: go test summary Sep 19, 2018
@rsc
Copy link
Contributor

rsc commented Sep 19, 2018

Note that if 2 failed it would say FAIL not pass, and it would also show the two failure outputs. Seeing "ok" means everything passed or was skipped.

If you want to build alternate displays, the new -json flag lets programs consume the test results and customize the output arbitrarily. That's probably the right thing to do instead of changing the default display.

@rsc rsc closed this as completed Sep 19, 2018
@cn007b
Copy link
Contributor Author

cn007b commented Sep 19, 2018

@rsc Yes, true, if 2 failed it would say FAIL not pass - my bad.
-json flag is really great, and provides many helpful info,
but maybe it would be helpful to have flag -stat and provide info in 1 line like: total, took, skipped, etc...

@manikesh
Copy link

manikesh commented May 7, 2019

what is the final outcome? -json is not giving satisfactory result.. was there any new command introduced? I could see issue is marked resolved.

@ianlancetaylor
Copy link
Contributor

We decided not to make a change here.

The reference to the -json output was meant to say that if you want an alternate display, you can run go test -json and pipe the data to another program that will read the JSON and format the output as you like.

@golang golang locked and limited conversation to collaborators May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants