microsoft / microsoft/codecoverage

`dotnet-coverage merge` drops hit counts, sets them all to 1

Open
#16 6 comments 5 reactions 1 assignee View on GitHub

@jakubch1 is already working on this.

Since Sep 14, 2022.

enhancement
Dominant language
C#
Stars
125
Forks
17
Avg merge
1h 17m
Merged PRs (30d)
2

Description

Description

The merge command produces coverage data with hits="1" hard-coded for all covered lines.

Steps to reproduce

I have multiple cobertura coverage reports that I want to use dotnet-coverage merge to merge into one.

Consider these coverage files:
TestResults.zip

dotnet-coverage merge TestResults\*xml -r -o merged.cobertura.xml -f cobertura

Expected behavior

I expect the merged report to reflect the hit counts for each line.
In particular, the merged product should report that the {reporoot}\test\Library.Tests\Calculator.cs file's line 17 was hit 3 times.

I get the expected result when merging with the dotnet-reportgenerator-globaltool dotnet CLI tool.

Actual behavior

Every line reported in the merged .xml file reports hits="1".

merged outputs.zip contains outputs from both tools so you can compare.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.