You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dotnet-coverage merge drops hit counts, sets them all to 1 #16
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".
Well, if this is by design, feel free to close. It seems odd that perf reasons come into play during a merge operation. And I'm surprised that tracking a bool is really that much faster than tracking and adding int, which ought to be roughly just as fast.
We are considering adding possibility to collect number of hits. So let's keep this open and see if more people wants that. You are right that in case of merging this will not make it slower.
Activity
jakubch1 commentedon Sep 14, 2022
Andrew Arnott (@AArnott) our tooling supports only
hits=1orhits=0for both collecting and merging. It is due to performance reasons.AArnott commentedon Sep 15, 2022
Well, if this is by design, feel free to close. It seems odd that perf reasons come into play during a merge operation. And I'm surprised that tracking a bool is really that much faster than tracking and adding
int, which ought to be roughly just as fast.jakubch1 commentedon Sep 15, 2022
We are considering adding possibility to collect number of hits. So let's keep this open and see if more people wants that. You are right that in case of merging this will not make it slower.
MattKotsenas commentedon Sep 23, 2022
+1 to wanting counts. We use this today to help find "hotspots" where we have duplicate tests (or duplicative test setup) that we can should clean up.
nbalu2 commentedon Mar 2, 2023
+1 just run into the same issue 🙄
tonyhallett commentedon Mar 21, 2024
This behaviour is also present when exporting from the Code Coverage Results window