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

Coverage not reported #322

Closed
dahu33 opened this issue Apr 11, 2023 · 1 comment · Fixed by #325
Closed

Coverage not reported #322

dahu33 opened this issue Apr 11, 2023 · 1 comment · Fixed by #325
Labels
bug Something isn't working

Comments

@dahu33
Copy link

dahu33 commented Apr 11, 2023

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

My golang version is 1.20.3.

@dnephin dnephin added the bug Something isn't working label Apr 11, 2023
@dnephin
Copy link
Member

dnephin commented Apr 11, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants