Comments (11)
Your XML contains this information about branches:
<BranchPoints>
<BranchPoint vc="2" uspid="108875" ordinal="0" offset="56" sl="23" path="0" offsetend="58" fileid="3073" />
<BranchPoint vc="2" uspid="108876" ordinal="1" offset="56" sl="23" path="1" offsetend="69" fileid="3073" />
</BranchPoints>
This seems to be correct. And then the HTML report will show 2 of 2 branches covered.
I created a similar class and I get 2 branches with both are shown as covered in the report.
Do you pass a single coverage report to ReportGenerator or several files?
from reportgenerator.
Thanks for your amazingly fast response.
I have a batch file which executes the coverage, which just uses one results.xml. The line of code which executes the Report Generator is this;
..\packages\ReportGenerator.2.1.3.0\reportgenerator.exe -reports:results.xml -targetdir:CoverageReport
I do execute three unit test projects through OpenCover (which calls mstest with three testcontainer arguments). To be sure, I've checked the file id's, but there's only one file with id '3073' as in the example.
from reportgenerator.
Could you provide the full results.xml?
from reportgenerator.
I took a look at the results.xml you have sent me.
I think I found the reason why you get strange results.
Each of your unit test assemblies use a separate copy of the X.BusinessLayer.dll.
The X.BusinessLayer.dll is referenced 4 times. One test assembly covers the two branches the others don't cover the relevant code.
ReportGenerator groups the assemblies by their name and then shows 2 of 8 branches as covered.
To fix this issue try using the following option when executing OpenCover: -mergebyhash
https://github.com/OpenCover/opencover/wiki/Usage#optional-arguments
Please let me know if this helps.
from reportgenerator.
Yes, this helps. My issue is resolved. Thanks a lot for your outstanding support!
from reportgenerator.
@danielpalme, I think I have a similar problem, but OpenCover's -mergebyhash
isn't working for me.
The OpenCover XML is reporting significantly different numbers than I'm getting from ReportGenerator.
I'd be happy to send along my files for troubleshooting.
from reportgenerator.
Please send me your OpenCover file.
And (if possible) a class file, where you think something is wrong.
from reportgenerator.
@danielpalme, I'll be sending you my file soon.
Specifically, I'm not sure if my branch point data is inaccurate, but ReportGenerator says I have 1897 classes and 56.7% branch coverage, while my OpenCover output says I have 2443 classes (1549 visited) and 60.63% branch coverage.
from reportgenerator.
@danielpalme, just realized I should tell you I emailed my file to you, in case it gets caught in your spam filters 😄
from reportgenerator.
I received your files. I will look into them within the next days.
This wiki page explains some metrics of ReportGenerator: https://github.com/danielpalme/ReportGenerator/wiki/Calculation-details
from reportgenerator.
Thanks, I appreciate the help!
from reportgenerator.
Related Issues (20)
- minimumCoverageThresholds:lineCoverage not working HOT 12
- Issue with -reporttypes field HOT 1
- Wiki Edit HOT 1
- Unable to convert opencoverxml file into corbertura.xml file using ReportGenerator in Azure Devops Pipeline HOT 3
- Release notice confuses me. HOT 1
- Why is the reportgenerator command installed using the dotent not working? HOT 2
- Report generated is always at version 5.1.14.0 on AzureDevops HOT 1
- Allow to specify the root path HOT 1
- Question: Is the format created by the CTC++ tool supported as input for report generator? HOT 2
- MS Coverage output isn't cleaning compiler generated methods/types HOT 13
- Ability to exclude classes from Risk Hotspots HOT 6
- Error while converting jacoco report to cobertura HOT 12
- Suggestion for new report type: MarkdownTableShortSummary HOT 2
- Sonarqube format clashes with DeterministicSourcePaths=true HOT 5
- Azure DevOps task option publishCodeCoverageResults doesn't work with relative targetdir path HOT 2
- Azure pipeline failure due to dependency on NodeJS version 6 HOT 3
- Docs/readmes: add info about `minimumCoverageThresholds` HOT 2
- ReportGenerator 5.3.1 fails on self hosted azure devops agent running on Amazon Linux 2 arm64 instance (t4g) HOT 2
- Question about lcov conversion HOT 4
- Strange source file references in a HTML report from dotnet-coverage on Linux HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reportgenerator.