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

Coverage is reported as decreased in PRs when it really isn't #99

Open
notmessenger opened this issue Apr 21, 2017 · 0 comments
Open

Coverage is reported as decreased in PRs when it really isn't #99

notmessenger opened this issue Apr 21, 2017 · 0 comments
Labels

Comments

@notmessenger
Copy link
Contributor

(Sorry for the reference to Ciena-internal PR numbers but they might be needed for additional context in the research of this, and I have included screenshots of the relevant information for discussion of this in an open manner since this is an open-source repository)

ISSUE

In MCP-UI PRs the coverage numbers are sometimes being presented as having decreased when in reality they have not ("SCENARIO 1" below). This is occurring when a PR is rebuilt because of merges into the master branch. Sometimes after another rebuild then it reports that there has been no change.

In other scenarios ("SCENARIO 2" below) a PR is submitted that makes changes to a config file, nothing that would affect coverage percentages, and it will report that coverage has dropped but then it is rebuilt and it does not report the same.

SUSPECTED CAUSE

Based on the patterns in the reporting numbers, some of which are presented below, and the scenarios described above, I suspect that this is due to a rounding error either in our code when we make the comparisons or in the underlying code generating the coverage reporting statistics.

SCENARIO 1: MCP PR 583

screen shot 2017-04-21 at 10 13 43 am

The first message written of

Code Coverage: 47.54% (increased 0.09% from 47.45%)

reflects the coverage reporting for this PR and everything is as expected.

The second message written of

Code Coverage: 47.52% (no change)

is the result of this PR being rebuilt due to an update to the master branch. Sometimes these numbers might change, sometimes they might not - just depends on what the change was. So this is an expected result as well.

The third message written of

Code Coverage: 47.52% (increased 0.02% from 47.50%)

gets a little interesting because I would not have expected to have seen the "from 47.50%" text but instead "from 47.52%". If the coverage number from the master branch is what is being used (because that is what is being merged in during the build) then it should have been the 47.52% from the second message written.

The fourth message written of

Code Coverage: 47.51% (dropped 0.01% from 47.52%)

is the one that causes me to suspect a rounding bug because this is the number reported, which represent the current code in the master branch combined with the code in this PR. Yet when the master branch is then merged into this PR and the coverage number are ran again there is no longer a drop of 0.01%. This same discrepancy plays itself out in "Scenario 2" below as well.

SCENARIO 2: MCP PR 584

screen shot 2017-04-21 at 10 47 59 am

This PR changed a value in the package.json file and the first message written of

Code Coverage: 47.51% (dropped 0.01% from 47.52%)

indicates the coverage has decreased, which should not be the case, as well as it is the same 0.01% difference seen in the fourth message written of "Scenario 1".

The second message written of

Code Coverage: 47.50% (dropped 0.02% from 47.52%)

was a result of the PR being rebuilt due to a manual request to do so (in order to clear the previous build failure due to coverage reporting) and not due to any changes in the master branch. This means that the code being evaluated is EXACTLY IDENTICAL yet the code coverage reporting yields different results.

At the time of this issue being created this PR was undergoing its 3rd build, without any changes to the master build, so the outcome of it can be checked at a later time, but there is enough information currently present and captured to represent the scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant