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

Show benchmark output in verbose formats #62

Closed
nhooyr opened this issue Aug 21, 2019 · 5 comments
Closed

Show benchmark output in verbose formats #62

nhooyr opened this issue Aug 21, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@nhooyr
Copy link
Contributor

nhooyr commented Aug 21, 2019

Right now unless you're using standard-verbose, running benchmarks at the same time as tests causes the benchmark output to be hidden. It'd be nice if it was parsed and shown in some nice colours.

@nhooyr nhooyr changed the title Parse benchmark output Parse go test bench output Aug 21, 2019
@nhooyr
Copy link
Contributor Author

nhooyr commented Aug 21, 2019

It doesn't need to show bench output always, maybe just make sure if a benchmark fails, the output is shown. I'm only running benchmarks for coverage/race detection purposes with go test.

@nhooyr
Copy link
Contributor Author

nhooyr commented Aug 21, 2019

Ah I believe it already does this, if a benchmark fails the output will be shown which is fine for my use case for now but it'd be nice to also show the output in a nice summary.

@dnephin dnephin changed the title Parse go test bench output Show benchmark output in verbose formats Aug 25, 2019
@dnephin dnephin added the enhancement New feature or request label Aug 25, 2019
@dnephin
Copy link
Member

dnephin commented Aug 25, 2019

Thanks for the report!

It looks like the standard-verbose format is the only one that works correctly. standard-quiet hides more output than go test, and both short-verbose and short formats don't show any output for benchmarks unless they fail.

I think it should make sense to show the output, at least in the verbose formats.

@dnephin
Copy link
Member

dnephin commented Aug 25, 2019

I took a look at the test2json output, and it does not appear to be working the way it is documented in https://golang.org/cmd/test2json/

Here's an example line:

"Time":"2019-08-25T14:14:19.671470609-04:00",
"Action":"output",
"Package":".../pkg/cmd",
"Test":"TestNearTimeoutWarning",
"Output":"BenchmarkCmdRunnerBaseline/testdata/1kL-500C.bench-8

The action should be bench not output, and the Test should be the name of the benchmark, not the last test that ran.

It seems there are bugs in the go test -json output which might make this hard to implement. I haven't found a related issue on the go bug tracker yet. That might be the first step required to fix this.

@nhooyr
Copy link
Contributor Author

nhooyr commented Nov 22, 2019

Going to close as it has been a while and I'm not sure if this is relevant anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants