Codecov report zero coverage for the code but full coverage for the tests

Description

I have a repo where locally, the test would run and the coverage is fine when running

pytest -v --cov qforce --cov-report=xml --color=yes qforce/tests

However, in the codecov, only the tests has been covered but actual code has not,

CI/CD URL

Codecov Output

Expected Results

I expect some coverage of the actual code.

Actual Results

Only the test has been covered.

Additional Information

The files that I think relevant are
qforce/CI.yaml at master · selimsami/qforce · GitHub for the CI
qforce/.codecov.yml at master · selimsami/qforce · GitHub for the codecov
qforce/.coveragerc at master · selimsami/qforce · GitHub for the general code convergence config

@xiki-tempula what does your coverage look like when you run it locally? I took a look at some of your coverage reports that you uploaded and they are showing no coverage.

Thank you for answering. Runing pytest -v --cov qforce --cov-report=xml --color=yes qforce/tests locally gives coverage.xml, which have the right coverage.
For example If I grab the initial two files

**<class** name **=** "__init__.py" filename **=** "__init__.py" complexity **=** "0" line-rate **=** "1" branch-rate **=** "1" **>**

**<methods/>**

**<lines>**

**<line** number **=** "1" hits **=** "1" **/>**

**<line** number **=** "3" hits **=** "1" **/>**

**</lines>**

**</class>**

**<class** name **=** "calculator.py" filename **=** "calculator.py" complexity **=** "0" line-rate **=** "0.35" branch-rate **=** "0.1667" **>**

**<methods/>**

**<lines>**

**<line** number **=** "1" hits **=** "1" **/>**

**<line** number **=** "2" hits **=** "1" **/>**

**<line** number **=** "3" hits **=** "1" **/>**

**<line** number **=** "6" hits **=** "1" branch **=** "true" condition-coverage **=** "100% (2/2)" **/>**

**<line** number **=** "8" hits **=** "1" **/>**

**<line** number **=** "10" hits **=** "1" **/>**

**<line** number **=** "11" hits **=** "0" **/>**

**<line** number **=** "12" hits **=** "0" **/>**

**<line** number **=** "13" hits **=** "0" **/>**

**<line** number **=** "15" hits **=** "1" **/>**

**<line** number **=** "16" hits **=** "0" **/>**

**<line** number **=** "17" hits **=** "0" branch **=** "true" condition-coverage **=** "0% (0/2)" missing-branches **=** "18,21" **/>**

**<line** number **=** "18" hits **=** "0" branch **=** "true" condition-coverage **=** "0% (0/2)" missing-branches **=** "19,21" **/>**

**<line** number **=** "19" hits **=** "0" **/>**

**<line** number **=** "21" hits **=** "0" branch **=** "true" condition-coverage **=** "0% (0/2)" missing-branches **=** "exit,22" **/>**

**<line** number **=** "22" hits **=** "0" **/>**

**<line** number **=** "24" hits **=** "0" branch **=** "true" condition-coverage **=** "0% (0/2)" missing-branches **=** "25,27" **/>**

**<line** number **=** "25" hits **=** "0" **/>**

**<line** number **=** "27" hits **=** "0" branch **=** "true" condition-coverage **=** "0% (0/2)" missing-branches **=** "exit,28" **/>**

**<line** number **=** "28" hits **=** "0" **/>**

**</lines>**

**</class>**

Which is what one would expect.

Upon further check, it seems that install the package with pip install -e . gives the correct coverage while python -m pip install . gives zero coverage for things other than tests.

@xiki-tempula that is really strange… do you happen to have SHAs of you doing those two things? I’d like to try to figure out why there is the issue. My guess is there might be a path mapping issue.

Sorry, I’m not quite sure about this SHAs.
Here is a commit where I did pip install -e . Codecov, where it seems that it is doing the right thing.
Here is anpther commit where I did pip install . Codecov, where only the tests has been covered.

@xiki-tempula strange indeed. I think this is a setup thing. You’ll see in pip install -e that the coverage files uploaded show coverage
image

(not that hits > 0)
while for the pip install . version, there is no coverage
image

I wonder if you could advise on what setup is done wrongly? Thank you very much.

@xiki-tempula I saw you did a bunch of work on the CI.yaml file. are you still running into issues? I don’t really understand your CI setup will enough to advise what might be happening.