0

I am using GitHub actions (for my Python library) to run a coverage report that is uploaded to CodeCov. After a lot of difficulty, I finally got the report running and uploaded to CodeCov. The problem is that the report says 100% of code in my tests was run (obviously) and 0% of everything except tests was run. Is there anything wrong with my codecov.yml file that is resulting in the coverage report only reporting on the code from the tests and not the code from the rest of the repo?

Codecov.yml file: https://github.com/MatthewReid854/reliability/blob/master/.github/workflows/codecov.yml

Codecov dashboard showing report results: https://app.codecov.io/gh/MatthewReid854/reliability

Thanks.

Matthew Reid
  • 332
  • 2
  • 9

1 Answers1

2

Tom from Codecov here.

tl;dr https://github.com/thomasrockhu/reliability/pull/1

Looks like there are a few things going on. First, you are pip installing the reliability repo. I think this is overwriting the reliability module over the local version. This would mean that coverage might be generated for those files as opposed to the local ones.

Second, I added a blank conftest.py file as indicated on this thread.

You should also note that Codecov needs to have a fetch-depth > 1 or 0 for the actions/checkout step.

Thomas Hu
  • 141
  • 5
  • Thanks so much for this. It works perfectly. I really appreciate your help. Since you're from codecov, can I suggest the info about the empty conftest.py file be added to the codecov documentation so future users can find it easily. – Matthew Reid Feb 26 '21 at 10:40
  • @MatthewReid I think this is actually a specific instance of using coverage.py as opposed to Codecov. Codecov was not receiving coverage information properly. I'll likely add this into a blog post or docs on coverage.py specific issues. – Thomas Hu Feb 27 '21 at 04:27