codecov-python icon indicating copy to clipboard operation
codecov-python copied to clipboard

Python .coverage files in nested directories ignored due to ignored_report

Open ben-spiller opened this issue 5 years ago • 2 comments

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.

ben-spiller avatar Apr 05 '19 17:04 ben-spiller

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.

moggers87 avatar Nov 30 '19 16:11 moggers87

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)

ben-spiller avatar Dec 02 '19 10:12 ben-spiller

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 a coverage.xml file to the root directory. The reason is that the combined .coverage-reports/.coverage file can't be picked up by the codecov program because of https://github.com/codecov/codecov-python/issues/198. However, it fortunately does pickup coverage.xml instead.

Thank you in advance for looking into it.

With kind regards, Andreas.

/cc @caronc

amotl avatar Oct 11 '22 16:10 amotl

@amotl as this package is getting deprecated, I would recommend moving to the Codecov Action

thomasrockhu avatar Oct 18 '22 15:10 thomasrockhu