Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out. report doesn't match when branch coverage is enabled

See original GitHub issue

Not sure if the same issue as #125, but I noticed that when I have branch coverage in, the reported coverage in Codecov doesn’t match (without coverage both work exactly the same).

The issue appears to be that Codecov doesn’t compute branch-coverage the same way as

This is the reported coverage without branch-coverage in both and Codecov (they match).



And this is the reported coverage with branch-coverage:



After comparing the reports with branch-coverage, it looks to me that looks at branches in the whole source code, including missed statements. While appears to ignore missed statements.

The file, for example, has the exact same coverage in when branch analysis is enabled and when it is disabled.

But with that number is different. And the reason is that there are missed branches in the missed statements. So considers those branches as missed too, while appears to not take those into consideration - which means it reports the same as if there was no branch analysis enabled, as there are no missed branches.

It would make more sense, in my opinion, to include the missed branches of the missed statements too - as the user specifically said s/he is interested in branch-coverage.

Cheers Bruno

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

blueyedcommented, Aug 31, 2020

@kinow FWIW I am using branch coverage for/with many projects, and codecov reports it properly.

I am not saying there might not be an issue somewhere of course. It still is more an issue with the server/backend then - so creating a support ticket is the way to go I think, yes.

ssbarneacommented, Nov 26, 2022

I am afraid that if you use pyproject.toml, this feature is not working. See

Read more comments on GitHub >

github_iconTop Results From Across the Web

Coverage not accurately reported - Bug Fixes - Codecov
Description I have a repository with >40 jobs in the main CI workflow. I am using GitHub Actions. I am using the fail_ci_if_error...
Read more >
What is Code Coverage - Codecov
Branch coverage tests to see if every branch in a conditional is tested. For example, if there is an if statement, it checks...
Read more >
The Coverage class — 6.2 documentation
If branch is true, then branch coverage will be measured in addition to the ... Files that match include will be measured, files...
Read more >
Adding coverage to your repository - Codacy Quality docs
Generate coverage reports in a supported format and upload them to Codacy to monitor the code coverage of your repositories on Codacy.
Read more >
Generate code coverage metrics - CircleCI
CircleCI provides different options for code coverage reporting using built-in CircleCI features combined with open source libraries, or using partners.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found