-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: coverage profile wonky with generics #68603
Comments
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
FWIW, most of the methods in those files are reported as uncovered, or parts of it covered and parts not, but the tests are driven by a very comprehensive suite, so I'm quite certain most - if not 100% even - lines should be reported covered in the package. |
Do you have a self contained reproducer for the issue? |
Does a 1.8GB repo count as self contained? |
Figured it out, you need |
Go version
go version go1.22.5 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
Go coverage reports seems to be an arbitrary rollercoaster when generics are involved.
Here's a report saying that a function in my package has no coverage:
https://app.codecov.io/github/karalabe/ssz/commit/f4f8d91d4d6d8a8b874f35934265b34b414a8c27/blob/codec.go#L70
And the exact same report calls that function with positive coverage:
https://app.codecov.io/github/karalabe/ssz/commit/f4f8d91d4d6d8a8b874f35934265b34b414a8c27/blob/tests/testtypes/consensus-spec-tests/gen_single_field_test_struct_ssz.go#L14
What did you see happen?
A call to function F is reported covered, but function F itself is reported uncovered.
What did you expect to see?
If the coverage tool reports a call to function F, I expect F to be reported as called.
The text was updated successfully, but these errors were encountered: