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

cmd/go: test -json issues #22734

Closed
bradfitz opened this issue Nov 15, 2017 · 1 comment
Closed

cmd/go: test -json issues #22734

bradfitz opened this issue Nov 15, 2017 · 1 comment
Milestone

Comments

@bradfitz
Copy link
Contributor

In #2981 (comment) , @zolotov writes:


I've tried to apply this feature in GoLand and this is the list of issues I faced:

  1. -json parameter doesn't work with -c argument
  2. -json parameter doesn't work with go bench. The only json output for benchmarks is package-passed event (btw, it's incorrectly "failed", looks like a bug), no information about starting, ending benchmarks or about text in stdout in json format.
PASS
ok  	github.com/rcrowley/go-metrics	40.797s
{"Time":"2017-11-11T12:55:29.076331942+03:00","Action":"fail","Package":"github.com/rcrowley/go-metrics","Elapsed":40.797}
…
  1. Some events have become a part of output of others, like this one:
/home/zolotov/dev/go/bin/go test -v -json ./... 
{"Time":"2017-11-11T13:05:28.267338195+03:00","Action":"run","Package":"github.com/rcrowley/go-metrics","Test":"TestCounterClear"}
{"Time":"2017-11-11T13:05:28.26745939+03:00","Action":"output","Package":"github.com/rcrowley/go-metrics","Test":"TestCounterClear","Output":"=== RUN   TestCounterClear\n"}
{"Time":"2017-11-11T13:05:28.267468575+03:00","Action":"output","Package":"github.com/rcrowley/go-metrics","Test":"TestCounterClear","Output":"{"Time":"2017-11-11T13:05:28.267472348+03:00","Action":"pass","Package":"github.com/rcrowley/go-metrics","Test":"TestCounterClear","Elapsed":0}
{"Time":"2017-11-11T13:05:28.267476892+03:00","Action":"run","Package":"github.com/rcrowley/go-metrics","Test":"TestCounterDec1"}

The third line is barely parseable.

@zolotov
Copy link
Contributor

zolotov commented Nov 28, 2017

  1. cmd/test2json: handle running command and processing output #22789
  2. cmd/go: test -json missing some conversions #22769
  3. Cannot recreate on the latest sources.

Can be closed, I think

@golang golang locked and limited conversation to collaborators Nov 28, 2018
@rsc rsc removed their assignment Jun 23, 2022
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

5 participants