gotestyourself / gotestsum

'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.
Apache License 2.0
2.04k stars 121 forks source link

Coverage not reported #322

Closed dahu33 closed 1 year ago

dahu33 commented 1 year ago

When I run gotestsum -- -cover ./... I don't have any coverage reported anywhere. Is that expected?

My golang version is 1.20.3.

dnephin commented 1 year ago

Thank you for the bug report! It looks like the go test -json output has changed. Instead of a separate line of output with

coverage: n% of statements

Now the coverage line seems to be appended to other lines, the "ok" line, and the elapsed time of the package.

I believe go1.20 made some changes to the test output, this may have been a side-effect. I don't see a Go issue about this yet. I imagine it's not a high priority for them to keep this output stable.

It shouldn't be too difficult to fix this in gotestsum.