Closed fleetingbytes closed 1 year ago
I found what the issue was. On the CI I did not install the project in editable mode, so when the tests imported the package, it ran from python/site-packages folder, rather than from the src. So coverage correctly reported that none of the code in the src folder ran.
Summary
the same command run locally vs. run in the Github CI produces vastly different coverage reports.
Expected vs actual result
running locally:
but run in Gitlab CI:
Why is the CI result different from my local run?
Reproducer
me
Versions
pytest 7.2.0 Python 3.10.4
Config
pyproject.toml (partial):
Code
https://github.com/Nagidal/codecov-demo Github CI runs when some insignificant changes are pushed, for example to the "step3" branch. (I was following the Codecov-demo Github Tutorial)
What has been tried to solve the problem
Many different variations of the
--cov
parameters and the default working directory of the CI job