-
Notifications
You must be signed in to change notification settings - Fork 219
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
Parser gojson incompatibility with go test's -coverprofile flag #134
Comments
Thanks. It looks like the testcase gets attributed to the wrong package, possibly because of the order in which it appears in the output. I don't think I've seen this before, it would be helpful if I could reproduce this output somehow. Can you share a bit more about the environment and the tests that you ran, e.g. what version of Go did you use and did you run any tests in parallel? Did you use any additional commandline options when running |
I can confirm that I have a similar issue regardless of whether I'm using a test coverage reporting or not. After disabling the test report in JSON, the tests run stably. |
I managed to reproduce by testing multiple packages at a time and enabling the race detector ( Until this has been fixed you can work around this problem by disabling the race detector, or not use the JSON test output. |
The reportBuilder assumed we were always processing events for a single package at a time. This is not true however when running `go test -json -race` for example. In order to properly support processing events from different packages we now have packageBuilders per package name. Fixes #134
I have been hit by the same bug now. Yes this is fixable by looking at the JSON tag. I can have a look at this and make a PR |
Ah, seems like we were using stable 2.0.0 version, which doesn't have this fixed, that's the reason. Nevermind! |
FYI |
When handle
yy.txt
Generated report contain incorrect content like this
command:
go test -json -race -coverpkg=./... -covermode=atomic -coverprofile=out/cover.out.tmp ./...
go version:
go 1.18
The text was updated successfully, but these errors were encountered: