question-mark
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.

ReportGenerator branch coverage does not match Cobertura input file

See original GitHub issue

I’m running ReportGenerator on a Cobertura XML file and the file contains this:

<coverage line-rate="0.859" branch-rate="0.758" version="1.9" timestamp="1546449905" lines-covered="275" lines-valid="320" branches-covered="50" branches-valid="66">

When I view the report, ReportGenerator is saying that my Branch coverage is 88% and not 75.8%:

image

I’m not merging any output files or anything fancy. I just have one Cobertura file that gets generated and I pass that directly in to ReportGenerator. Why is this happening?

Version: ReportGenerator 4.0.4

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ToastyMallowscommented, Jan 3, 2019

Ok that makes sense. Thanks for the explanation @danielpalme!

0reactions
danielpalmecommented, Jan 3, 2019

Yes ReportGenerator does not reuse the numbers of the Cobertura file.

Reasons:

  • The numbers are not always easy to understand (see above)
  • ReportGenerator also supports other input formats (not only Cobertura), which have other metrics
  • ReportGenerator supports merging of several files
Read more comments on GitHub >

github_iconTop Results From Across the Web

Mismatch between Branch Coverage in Cobertura and ...
We are generating code coverage using dotnet test, coverlet, and cobertura. We are using ReportGenerator to combine the coverage results and ...
Read more >
Azure devops reportgenerator task can't find coverage. ...
The coverage.cobertura.xml is expected input file but it's not generated. In my experience, it's because your dotnet test task didn't ...
Read more >
Code Coverage in VSTS with xUnit, Coverlet and ...
Here we are invoking the .Net Core CLI tool ReportGenerator.exe, as explained before, setting the input file to coverage.cobertura.xml, the ...
Read more >
Publish code coverage results v1 task
Specifying a path to source files is required when coverage XML reports don't contain an absolute path to source files.
Read more >
The Easiest Way to Generate and Publish .NET Code ...
This argument creates a $(Agent.TempDirectory)/*/coverage.cobertura.xml code coverage report file. This folder is default output folder since ...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found