Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge-JaCoCoReport: Calculates hit count correctly? #392

Open
johlju opened this issue Aug 3, 2022 · 0 comments
Open

Merge-JaCoCoReport: Calculates hit count correctly? #392

johlju opened this issue Aug 3, 2022 · 0 comments
Labels
discussion The issue is a discussion.

Comments

@johlju
Copy link
Collaborator

johlju commented Aug 3, 2022

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>:

if ($oPackageLine.ci -lt $mPackageLine.ci)
{
# Missed line in origin, covered in merge
Write-Verbose " Updating line: $($mPackageLine.nr)"
$oPackageLine.ci = $mPackageLine.ci
$oPackageLine.mi = $mPackageLine.mi
continue
}

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?

Example:

  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" />

Verbose logs

n/a

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

n/a

PowerShell version and build the target node is running

n/a

Module version used

0.115.0
@johlju johlju added the discussion The issue is a discussion. label Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion The issue is a discussion.
Projects
None yet
Development

No branches or pull requests

1 participant