-
Notifications
You must be signed in to change notification settings - Fork 31
Description
I discovered that coverage reports containing duplicate blocks for the same source code segment are parsed incorrectly, resulting in inflated or inaccurate coverage percentages. The current parser counts duplicate blocks multiple times instead of merging or deduplicating them.
This issue can arise from certain Go test configurations or tooling that produce repeated blocks in coverage output.
Impact:
The coverage percentage values produced by this action often differ significantly from the "true" value and those reported by go tool cover. For example, in one test case, the action reported ~20% coverage while go tool cover -html showed ~95% coverage. This discrepancy can cause confusion and mistrust of coverage results.
Fix
I have a PR ready with the fix, including tests and sample coverage files demonstrating the problem.
This fix aligns the parsing logic with how go tool cover handles coverage blocks — it correctly calculates total coverage after profile parsing and block deduplication logic in ParseProfilesFromReader.
Looking forward to feedback and hoping this can be merged to improve coverage accuracy.
Thanks!

