-
Notifications
You must be signed in to change notification settings - Fork 392
Description
I use coverlet to analyze my .NET Core 2.1 app and it outputs cobertura format, then I use report-generator to convert the result file into HTML format for human reading, it's been using in our project for a while and I still haven't figured out some strange issues.
- I have a class called BlockController, in the coverage result file I found compiler generated classes shown in parallel with BlockController, see screenshot below. I wonder if coverlet can eliminate those classes and combine the coverage data with the actual BlockController.
-
The method name has something as a suffix, take this
EaseSource.AnDa.SMT.Web.Controllers.BlockController/<GetAll>d__2
, what's the "d__2"? -
There is one aggregation level missing in the report, the coverage result of all methods in BlockController should be aggregated to BlockController to show the total coverage of this class, unfortunately this is not done, I guess it's because in the coverage result output file, the method coverage data is put in the element, e.g.
<class name="EaseSource.AnDa.SMT.Web.Controllers.BlockController/<GetByIds>d__5" filename="Web\Controllers\BlockController.cs" line-rate="1" branch-rate="0.5" complexity="0">
<methods>
<method name="MoveNext" signature="()" line-rate="1" branch-rate="0.5">
<lines>
<line number="496" hits="1" branch="True" condition-coverage="50% (1/2)">
<conditions>
<condition number="343" type="jump" coverage="50%" />
</conditions>
</line>
<line number="497" hits="1" branch="False" />
<line number="498" hits="1" branch="False" />
<line number="499" hits="1" branch="False" />
<line number="500" hits="1" branch="False" />
<line number="501" hits="1" branch="False" />
<line number="503" hits="1" branch="False" />
<line number="504" hits="1" branch="False" />
</lines>
</method>
</methods>
<lines>
<line number="496" hits="1" branch="True" condition-coverage="50% (1/2)">
<conditions>
<condition number="343" type="jump" coverage="50%" />
</conditions>
</line>
<line number="497" hits="1" branch="False" />
<line number="498" hits="1" branch="False" />
<line number="499" hits="1" branch="False" />
<line number="500" hits="1" branch="False" />
<line number="501" hits="1" branch="False" />
<line number="503" hits="1" branch="False" />
<line number="504" hits="1" branch="False" />
</lines>
</class>
The output cobertura file for this class is also attached.
coverage.cobertura.xml.zip
Please advice, thanks.