Skip to content

Opencover sequence & branch coverage numbers are reported incorrectly #315

@charlieschmidt

Description

@charlieschmidt

Regardless of actual line or branch coverage, the xml output for opencover format is incorrect in two ways:

  1. the sequence/branch/coverage numbers should be 0-100, not 0-1 measurements.
  2. in the toplevel summary, the sequenceCoverage and branchCoverage properties are the same, when they should be different as reported by the text output

text output:

Total tests: 23. Passed: 23. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 8.1746 Seconds

  Generating report '..\build\opencover\reports\coverage.xml'

+------------------+--------+--------+--------+
| Module           | Line   | Branch | Method |
+------------------+--------+--------+--------+
| CompanyNameA     | 25.3%  | 62.8%  | 18.4%  |
+------------------+--------+--------+--------+

first lines of coverage.xml:

<?xml version="1.0" encoding="utf-8"?>
<CoverageSession>
  <Summary numSequencePoints="801" visitedSequencePoints="203" numBranchPoints="801" visitedBranchPoints="203" sequenceCoverage="0.253" branchCoverage="0.253" maxCyclomaticComplexity="0" minCyclomaticComplexity="0" visitedClasses="28" numClasses="30" visitedMethods="43" numMethods="234" />

This can't be the case, per the text output and the coverage details nested below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions