Open johlju opened 2 years ago
Currently the hit count is overwritten when the merge document's <line> has a hit count higher than the original document's <line>:
<line>
https://github.com/gaelcolas/Sampler/blob/02cc8da49a8d837f48c167db56c1ace18fdb5bef/Sampler/Public/Merge-JaCoCoReport.ps1#L89-L96
But shouldn't the hit count of the merge document be added to the count of the original document?
Example:
Original ci = 1 Merge ci = 2 Result: 3
And shouldn't it always add to the hit count, not just when original line is less than the merge line?
Original ci = 1 Merge ci = 1 Result: 2
This is also true for missed hit count that can be more than 1.
Example from the project SqlServerDsc and the DSC resource SqlAg (DSC_SqlAg.psm1):
<line nr="300" mi="3" ci="0" mb="0" cb="0" /> <line nr="301" mi="1" ci="0" mb="0" cb="0" /> <line nr="303" mi="2" ci="0" mb="0" cb="0" />
n/a
I possible to create a unit tests that shows that hit count is overwritten.
Uncertain how hit count should be calculated so I opened this issue for future improvement.
Current behavior could be correct, but feels wrong.
0.115.0
Problem description
Currently the hit count is overwritten when the merge document's
<line>
has a hit count higher than the original document's<line>
:https://github.com/gaelcolas/Sampler/blob/02cc8da49a8d837f48c167db56c1ace18fdb5bef/Sampler/Public/Merge-JaCoCoReport.ps1#L89-L96
But shouldn't the hit count of the merge document be added to the count of the original document?
Example:
And shouldn't it always add to the hit count, not just when original line is less than the merge line?
Example:
This is also true for missed hit count that can be more than 1.
Example from the project SqlServerDsc and the DSC resource SqlAg (DSC_SqlAg.psm1):
Verbose logs
How to reproduce
I possible to create a unit tests that shows that hit count is overwritten.
Expected behavior
Uncertain how hit count should be calculated so I opened this issue for future improvement.
Current behavior
Current behavior could be correct, but feels wrong.
Suggested solution
Uncertain how hit count should be calculated so I opened this issue for future improvement.
Operating system the target node is running
PowerShell version and build the target node is running
Module version used