Coverage not calculated correctly if coverage report is uploaded without files being present #1707
Labels
Area: Report Processing
Issues with report processing
bug
Something isn't working
Eng Area: Worker: Coverage Upload Processing
Medium
Medium Priority Issues (to be fixed or re-evaluated in 3 months
We have recently updated our CI workflow to use sharding in Jest to speed up the tests. The flow is something like this:
actions/upload-artifact
.actions/download-artifact
, merge into a single json and report to Codecov viacodecov/codecov-action
.The problem was that job 4 didn't checkout the repo (because it didn't really need those files).
When
codecov-action
was used without the repo being present, even though the coverage file was uploaded, it always saidAll modified and coverable lines are covered by tests ✅
and all changes were reported as indirect changes.File paths were incorrect (extra
webui
) and clicking on the file resulted in an error:2024-11-29.10.45.32.mov
Example of a bad job:
https://github.com/truenas/webui/actions/runs/12073223216/job/33669795147?pr=11114
After I added repo checkout as a step, everything started to work correctly:
https://github.com/truenas/webui/actions/runs/12082374244/job/33694460349?pr=11114
You can see my previous CI configuration and fixes in the associated PR. There were no important changes in how coverage file is generated.
While this is a configuration error, I feel like there could be something to improve on Codecov's end:
The text was updated successfully, but these errors were encountered: