Description
Coverage for __init__.py
is suddenly being ignored in reports uploaded to codecov. I still get coverage for these files in the locally generated coverage output. It’s only when I view the report online that these files seem be ignored.
This started happening about 6 days ago following this totally innocuous commit on my repo: Release v3.15.3 · lexicalunit/spellbot@ff593b8 · GitHub
Repository
CI/CD
GitHub Actions
Uploader
Commit SHAs
committed 04:33AM - 02 Aug 20 UTC
Codecov YAML
I don’t have any codecov.yml
file. I do have a .coveragerc
file though if that matters:
[run]
branch = True
source = src/spellbot
omit =
src/spellbot/_version.py
src/spellbot/versions/env.py
[report]
ignore_errors = True
exclude_lines =
pragma: no cover
raise NotImplementedError
if __name__ == .__main__.:
tom
August 8, 2020, 4:07pm
2
Hi @lexicalunit , I’m guessing this might be a path fixing issue. Could you try adding something like
fixes:
"::src/spellbot/"
Hey @tom , I don’t see a fixes
configuration property documented here: Configuration reference — Coverage.py 7.0.4 documentation
Did you mean that I should put that somewhere else other than .coveragerc
? If so, where?
Ah, I see it’s a setting in codecov.yml
. I don’t actually have that file. Do I just add it to the root of my repository? I guess I can try that.
@tom Ok I added that file with those contents to the root of my repository: Trying to fix codecov · lexicalunit/spellbot@0a95520 · GitHub
But the report is still ignoring __init__.py
: Code coverage done right.
Please note that codecov started ignoring this file randomly about 6 days ago after no changes on my part so I’m pretty sure it’s not something I changed. This used to work fine. Something broke or changed on codecov’s side of things for sure.
tom
August 10, 2020, 4:50pm
6
Hi @lexicalunit , this is my fault, it should read
fixes:
- "::src/spellbot/"
It is quite strange that it stopped working 6 days ago, I don’t see anything in particular that should signal a shift. If that doesn’t work, let me know, and I can dig in a bit deeper.
Thank you @tom . I added the file to my repo: Trying to fix codecov · lexicalunit/spellbot@4c01af6 · GitHub
But it still seems to be ignoring the __init__.py
files: Code coverage done right.
tom
August 10, 2020, 6:06pm
8
Posting there here so it won’t get lost.
Some additional info about the issue:
opened 05:54PM - 10 Aug 20 UTC
closed 06:05PM - 10 Aug 20 UTC
Starting a little over a week ago `__init__.py` files are removed from codecov r… eporting.
### Output from my test suite
Showing that `__init__.py` is part of the coverage output, and therefore should be see in the corresponding codecov report.
```
poetry run coverage report -m
Name Stmts Miss Branch BrPart Cover Missing
-------------------------------------------------------------------------------------------------------------------------------------
src/spellbot/__init__.py 864 21 395 15 97% 487->488, 488, 491->492, 492, 494->495, 495, 498->499, 499, 505->506, 506, 509->510, 510, 513->514, 514, 616->619, 619-624, 1060->1093, 1075->1076, 1076, 1113->1116, 1341->1342, 1342-1344, 1546->1547, 1547-1549, 1581->1578, 1642->1646, 1646
src/spellbot/assets.py 21 0 2 0 100%
src/spellbot/constants.py 6 0 0 0 100%
src/spellbot/data.py 185 0 43 0 100%
src/spellbot/reactions.py 18 0 4 0 100%
```
### `.coveragerc`
```
[run]
branch = True
source = src/spellbot
omit =
src/spellbot/_version.py
src/spellbot/versions/env.py
[report]
ignore_errors = True
exclude_lines =
pragma: no cover
raise NotImplementedError
if __name__ == .__main__.:
```
### `codecov.yml`
None.
### Before
An example of a good report from a little over a week ago.
- Commit: https://github.com/lexicalunit/spellbot/commit/f21cccdb58700c918f59dbeaa2ebb25752a63c14
- Codecov Report: https://codecov.io/gh/lexicalunit/spellbot/tree/f21cccdb58700c918f59dbeaa2ebb25752a63c14/src/spellbot
See how it contains coverage for `__init__.py`? This is correct.
### After
After changing nothing about `.coveragerc` or my CI configuration, I suddenly started getting reports that are omitting `__init__.py`. For example:
- Commit: https://github.com/lexicalunit/spellbot/commit/ff593b818d42d15bce99137b3d5b809ffe8ef2fc
- Codecov Report: https://codecov.io/gh/lexicalunit/spellbot/tree/ff593b818d42d15bce99137b3d5b809ffe8ef2fc/src/spellbot
Suddenly the `__init__.py` files have just been removed from the codecov report.
### Things I've tried
Adding a `codecov.yml` file with the following contents to the root of my repository.
```yaml
fixes:
- "::src/spellbot/"
```
- Commit: https://github.com/lexicalunit/spellbot/commit/4c01af61123120a7920526a41c3fbc59716b6401
- Codecov Build: https://codecov.io/gh/lexicalunit/spellbot/commit/4c01af61123120a7920526a41c3fbc59716b6401/build
- Codecov Report: https://codecov.io/gh/lexicalunit/spellbot/tree/4c01af61123120a7920526a41c3fbc59716b6401/src/spellbot/src/spellbot
You can see in the build details that it picked up the `codecov.yml` file. However the report is still omitting the `__init__.py` files.
tom
August 12, 2020, 6:49pm
9
Hi @lexicalunit , would you be able to try
fixes:
- "__init__.py::src/spellbot/__init__.py"
1 Like
Uh… weird. I am now getting some weird error on my reports.
The error is: “Unable to find report content in the storage archive”
Not sure why this is suddenly happening or if it’s at all related to this change?