We currently have a large number of separate tests run per pull request, and in the past Codecov’s ability to automatically merge coverage reports has worked perfectly.
However, one PR in our repository (#721) seemed to have an issue with coverage report merging; everything would work fine as each test job finished (Codecov would show slowly increasing coverage percentage), until our last test job, qchem-tests, finished. The last test job would ‘overwrite’ the coverage report, suddenly lowering coverage from 98% to 95%.
Due to urgency this PR was merged, and this issue now affects the master branch and all other PRs.
Repository
CI/CD
We are using GitHub actions to generate the coverage report.
Hi @josh146, I’d love a little more information here. When you say last test job, is this a coverage report that is generated and uploaded to Codecov? If so, can you supply a build URL? What are you expecting to be different in these changes? And finally, I noticed you were using an old version of the Actions uploader. This shouldn’t cause this issue above, but it’s worth noting.
For each PR, we have multiple jobs run on GitHub actions. Each one tests a different part of the project, so the coverage report from all jobs needs to be merged to get an accurate measurement of the coverage.
the jobs labelled core-tests include unit tests of the pennylane directory
the job labelled qchem-tests includes unit tests of the qchem/pennylane_qchem directory
The qchem-tests job takes the longest to run and always finishes last. In this issue, once the qchem-tests coverage report is uploaded, the coverage of the pennylane directory instantaneously decreases as you note in the link to the ‘Coverage Change’.
Hi @josh146, I’m guessing this might be because of the base commit that we are comparing to here. Do you have a PR that I can take a look at with this issue? Possibly with only one or two commits?
I have a similar issue. Reports coming from different tests overwrite each other, so my overall coverage is reported less than the actual thing! This happens on pushes to master!
In the 63% case, you’ll see there are more lines with explicit coverage like in src/SnoopCompileBot.jl
63%
73%
Notice in particular line 122. This means that you probably have no explicit coverage (the line doesn’t show up in your coverage reports) until the last one. In fact, you can find in the first build.
The other coverage reports do not have a line for 122
@josh146, not quite. What is happening is that for the first 4 uploads, they are not collecting coverage information on every line. As an example, you can view all the builds and check line 78. In the first 4 that show 99% coverage, line 78 is missing, meaning that there is no information (covered or not). WIth the latest, it explicitly is saying line 78 is not covered. So unless we have another report stating that 78 is covered, we will use that information.
However it doesn’t seem to be the full issue; in __init__.py, only 6 lines in the file are being excluded from the coverage in the first 4 uploads. On the other hand, the last report shows 29 missing lines of coverage — some of these lines I can see are explicitly covered in the first 4 (example: lines 224-247).
Another thing I noticed that might be important: this issue only showed up when we switched from CircleCI to GitHub Actions. Previously, when we used a CircleCI test matrix, the final report correctly showed coverage of the PennyLane folder.
Oh this is really interesting @josh146. It looks like this is an issue with the paths that are reported. If you use the report selector
you’ll see that Codecov is unable to find coverage for this file for the first 4 coverage reports. I’ll dig in here to see what a fix might be. Would you be able to provide an output from the CircleCI run?
Hi @tom, just wondering if there is an update on your side The coverage reporting is causing a few issues for our developers, so anything to help alleviate it will be greatly appreciated!
Hi @josh146, sorry for the delay here. It looks like the Travis build is for a different organization XanaduAI. Do you have a build under PennyLaneAI? I want to be able to compare builds between two commits from each CI.
Hi @tom, unfortunately not. The repository was transferred from XanaduAI (where we were using Travis) to PennyLaneAI (where GitHub actions are being used). After the transfer, we noticed the Codecov issues.
Note that although the org name changed, it is the same (unmodified) repository.