Skip to content
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

Coverlet Coverage does not match coverage reported from Report Generator reports #84

Closed
joshclark opened this issue May 3, 2018 · 3 comments

Comments

@joshclark
Copy link

joshclark commented May 3, 2018

When coverlet runs on my project it reports 72.7%. When I take the output (I used the opencover reporter) and run that through ReportGenerator, it shows the coverage as 66.7%. If I change the output to Cobertura I get 62.2%

Opening the coverage.xml file I see this summary:

  <Summary numSequencePoints="2015" 
           visitedSequencePoints="1254" 
           numBranchPoints="142" 
           visitedBranchPoints="142" 
           sequenceCoverage="0.727" 
           branchCoverage="0.727" 
           maxCyclomaticComplexity="0" 
           minCyclomaticComplexity="0" 
           visitedClasses="120" 
           numClasses="203" 
           visitedMethods="310" 
           numMethods="447" />

It looks like the sequenceCoverage attribute matches what coverlet reports. It looks like visitedSequencePoints / numSequencePoints matches what ReportGenerator is reporting for Cobertura.

I would expect the two tools to report the same value. I have not yet researched where those numbers are coming from.

Update:
It looks like the problem might be here (https://github.com/tonerdo/coverlet/blob/master/src/coverlet.core/CoverageSummary.cs) where the code takes the average of averages rather than calculating the actual average from the raw data.

@hunterjm
Copy link
Contributor

hunterjm commented May 4, 2018

See #73

@tonerdo
Copy link
Collaborator

tonerdo commented May 11, 2018

Will have a release with this fix by Monday

@tonerdo
Copy link
Collaborator

tonerdo commented May 17, 2018

New version released https://www.nuget.org/packages/coverlet.msbuild/2.0.0

@tonerdo tonerdo closed this as completed May 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants