BUG: matching filename in another directory cause a file to be ignored

I have a file src/generate.py which is being ignored by codecov for no good reason (I can see it in the coverage.xml file uploaded to codecov).

By chance I discovered the reason for this is that I have another file named demo/generate.py (the demo directory is not included in coverage and this file is not references in coverage.xml).

When I renamed demo/generate.py -> demo/run.py, coverage for src/generate.py started showing.

I noticed this when looking at the “Files” tab on a commit and seeing the files listed under “Other files ignored by Codecov”

It looks like you have some broken logic around deciding which files to ignore.

(unfortunately the repo is private, so I can’t share the exact files and changes)

@samuelcolvin, are you able to provide a commit SHA?

It was fixed in c47e96a1d9d86ee8c3e9398acd5ebb07a9d5746a

The problem was still present in 6176d2dd9ce40ff527792047d67cca3d76aa0970

But surely quicker to create your own repo and check for the problem?

@tom any update on this?

It’s quite a fundamental bug, and pretty easy to validate.


But surely quicker to create your own repo and check for the problem?

Yes, but I wanted to make sure that any fixes we make also fix your use case. This is a particularly complicated fix on our side and it’s going to take a little bit of time. I’ll keep this thread updated.

It was fixed in c47e96a1d9d86ee8c3e9398acd5ebb07a9d5746a

Unfortunately, that commit SHA is a little too old for our logs. Would you be able to DM me another, or at least the full repo name?

I have the same issue with a project I maintain: pesos/browser-history

browser_history/utils.py is ignored because tests/utils.py exists (browser_history/__init__.py is similarly ignored).

Here is a recent commit that shows that utils.py is ignored.

Is there a workaround to this without having to rename either of the files?

Hi @Samyak, unfortunately there’s no good workaround without doing a file rename. We are working on a fix for this.

Just noting that we are still looking into this. Thanks for your patience here.

Thank you for looking into it. If possible, can you give an estimate of when it will be fixed?

Hi @Samyak, unfortunately, this will require a significant amount of work from our side to refactor. If I had to guess, I would say a month or two, but I really can’t say with real certainty.

1 Like