Skip to content

Code coverage not 100% on record #186

@tomap

Description

@tomap

Hello,

I'm using dotnet 9
I'm running the tests via dotnet test

  • .runsetings file :
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">   

I use reportgenerator to view the coverage:

Image

And for the record, there is an line matching the declaration of the record that is not covered

<function id="2625" name=".ctor(System.Guid)" namespace="CC.Core.Commands" type_name="GetRicFeedbackCommand" block_coverage="0.00" line_coverage="100.00" blocks_covered="0" blocks_not_covered="0" lines_covered="4" lines_partially_covered="0" lines_not_covered="0">
  <ranges>
    <range source_id="380" start_line="14" end_line="14" start_column="0" end_column="0" covered="yes" />
    <range source_id="380" start_line="15" end_line="15" start_column="0" end_column="0" covered="yes" />
    <range source_id="380" start_line="16" end_line="16" start_column="0" end_column="0" covered="yes" />
    <range source_id="380" start_line="17" end_line="17" start_column="0" end_column="0" covered="yes" />
  </ranges>
</function>
<function id="2626" name="get_WorkspaceKey()" namespace="CC.Core.Commands" type_name="GetRicFeedbackCommand" block_coverage="0.00" line_coverage="100.00" blocks_covered="0" blocks_not_covered="0" lines_covered="1" lines_partially_covered="0" lines_not_covered="0">
  <ranges>
    <range source_id="380" start_line="18" end_line="18" start_column="0" end_column="0" covered="yes" />
  </ranges>
</function>
<function id="2627" name="set_WorkspaceKey(System.Guid)" namespace="CC.Core.Commands" type_name="GetRicFeedbackCommand" block_coverage="0.00" line_coverage="100.00" blocks_covered="0" blocks_not_covered="0" lines_covered="1" lines_partially_covered="0" lines_not_covered="0">
  <ranges>
    <range source_id="380" start_line="18" end_line="18" start_column="0" end_column="0" covered="yes" />
  </ranges>
</function>
<function id="2628" name=".ctor(CC.Core.Commands.GetRicFeedbackCommand)" namespace="CC.Core.Commands" type_name="GetRicFeedbackCommand" block_coverage="0.00" line_coverage="0.00" blocks_covered="0" blocks_not_covered="0" lines_covered="0" lines_partially_covered="0" lines_not_covered="1">
  <ranges>
    <range source_id="380" start_line="12" end_line="12" start_column="0" end_column="0" covered="no" />
  </ranges>
</function>

=> .ctor(CC.Core.Commands.GetRicFeedbackCommand) => covered="no"

I already reported the issue on ReportGenerator project where the conclusion was that the issue came from the cobertura report, not reportgenerator danielpalme/ReportGenerator#749

And it seems coverlet gets it right danielpalme/ReportGenerator#749 (comment)

Does the issue come from Microsoft.CodeCoverage ? Am I posting the issue in the right repo ?
Is it a matter of "interpretation" (I understand that there is some generated "wiring code" generated for records which might not be covered) ?

Thank you for your help

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions