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

Comments

Projects
None yet
6 participants
@cn007b
Copy link
Contributor

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

@gopherbot gopherbot added the Proposal label 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

This comment has been minimized.

Copy link
Contributor

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 Sep 19, 2018

@cn007b

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.