codecov-python
codecov-python copied to clipboard
Python .coverage files in nested directories ignored due to ignored_report
If I have a Python .coverage file in my current directory when I run codecov it finds it, but any .coverage files from child directories seem to be completely ignored.
This seems to be because of the regex r'(/.coverage.*)|' in the ignored_report
list - but I can't figure out why that's there? Especially as the expression '([^/]coverage[^/])|' is listed in the is_report
list so seems like these files are being explicitly included and then also explicitly ignored.
It doesn't seem to make sense to ignore Python .coverage files since the whole point of walking the directory tree is surely to look for exactly those files?
Looks like I need to write my own script to walk the directory tree and copy out all the coverage files to a common directory (with renaming) - which makes this a lot harder to use than necessary.
I don't think this has anything to do with ignored_report
- I think that's just to make sure .coverage
files don't end up in the report as files that are missing coverage.
However, it would be nice if codecov had the option to look in places other than the current working directory for coverage data.
However, it would be nice if codecov had the option to look in places other than the current working directory for coverage data.
Thanks. The requets here is not to specify other directories explicitly, but rather to (optionally) do a recursive search under the current directory, to pick up coverage files from all tests (typicalyl far too many to explicitly list on the command line)
Hi.
[@ben-spiller] If I have a Python
.coverage
file in my current directory when I run codecov it finds it, but any.coverage
files from child directories seem to be completely ignored. [@moggers87] it would be nice if codecov had the option to look in places other than the current working directory for coverage data.
I've upvoted the issue because we may have been running into the same thing at https://github.com/caronc/apprise/pull/690#discussion_r992829299. This is the workaround we are currently using:
Running
coverage xml
is needed to write out acoverage.xml
file to the root directory. The reason is that the combined.coverage-reports/.coverage
file can't be picked up by thecodecov
program because of https://github.com/codecov/codecov-python/issues/198. However, it fortunately does pickupcoverage.xml
instead.
Thank you in advance for looking into it.
With kind regards, Andreas.
/cc @caronc
@amotl as this package is getting deprecated, I would recommend moving to the Codecov Action