`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.

Assessment

This issue has not been assessed yet.

Description

enhancement

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.

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

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.

More from microsoft/codecoverage

All issues in microsoft/codecoverage

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.