Skip to content

Codecov reports wrong coverage diffs #3136

@mnmelo

Description

@mnmelo

Couldn't find a discussion on this problem. Sorry if it's a duplicate.

Expected behavior

Codecov CI should report coverage diffs that reflect the impact of modifications a new tests in a given PR.

Actual behavior

Nonsensical values are reported, which sometimes cause the build to fail due to a perceived drop in the overall project's coverage. An example is the recent PR #3135, where diff lines had 100% coverage but overall the project coverage dropped by 0.45%.

It is mathematically possible for a 100% covered diff to cause a drop if the overall number of project lines decreases; but in the case of #3135 the total number of lines also increased, so there's definitely something off.

I didn't explore much the API of codecov, but something that may be a hint is that for each PR multiple builds are reporting coverage values, and several with the same identifier (see the report for the latest commit into develop). Could that be a source of confusion when calculating diffs?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions