Codecov can't open files with the same name and the report for them is missing

I have at least a few files that have the same name in different folders, codecov is having trouble opening it I guess, I have a lot of “cannot open source file” in the log file. I feel that this might be a bug, please move the post if it isn’t.

It’s possible to see the file in the github folder, but it does not appear in the report at all, this happens in a few other folders of the project and it always happens with this file (aap.cpp) that has the same name but the code is obviously different.

I tried to do this fix

but it didn’t work, can anyone help me please? thanks!

To clarify, this is in your raw report? Codecov parses the uploaded report, errors in it would be created by your coverage reporter.

yes, this is the raw report of the “upload coverage data” section. Not sure what do you mean by the errors in the coverage reporter.

this is the whole file:

https://pastebin.com/9uhxgBxV

thanks!

Thanks for sharing, I misunderstood what you were saying. Can you try adding -X gcov to the bash uploader and let me know the commit SHA after?

I ran with -X gcov but I didn’t undestand what you mean by SHA after… our last commit is:
dc17e12f519a2023a787cfd2a56c18f82b0abfda

I get this message when I run with -X gcov

No CI provider detected.
Testing inside Docker? http://docs.codecov.io/docs/testing-with-docker
Testing with Tox? https://docs.codecov.io/docs/python#section-testing-with-tox
project root: .
./codecov.sh: line 887: hg: command not found
Yaml not found, that’s ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
==> gcov disabled
==> Python coveragepy not found
==> Searching for coverage reports in:
+ .
–> No coverage report found.
Please visit http://docs.codecov.io/docs/supported-languages

There some other odd issues, this file in the image bellow is at the root of the project in the codecov dashboard, but it’s actually located in a completely different folder (I would show with more pictures, but I can’t post more than 1 picture yet). If I click on the link, I get a 404 page.

The only thing in common with all those issues is that those files have the same/similar name, this sl_be.cpp actually has a SL_BE.cpp file (just the case is different) that is located in the root… the lowercase sl_be.cpp is inside the folder “adhoc_utilities/sl_be/”.

(I fixed your ability to post images)

When I said the SHA after, I meant the commit that you shared, but since we didn’t find any reports to upload… :thinking:

The issue with the multiple files by the same name being in the wrong place has been identified and ill ship soon, I believe.

By disabling the bash uploader’ gcov, we would need to have you generate the file yourself. Can you confirm the reports do exist?

Also, at the time you run the bash uploader, or the source files still present, or is this in a separate job?

yes, the reports do exist, I can see them in the log like this:

2020-01-22T16:02:28.8275921Z File ‘aap.cpp’
2020-01-22T16:02:28.8276195Z Lines executed:85.92% of 4027
2020-01-22T16:02:28.8276292Z Branches executed:92.23% of 10496
2020-01-22T16:02:28.8276548Z Taken at least once:51.86% of 10496
2020-01-22T16:02:28.8276640Z Calls executed:88.76% of 5923
2020-01-22T16:02:28.8276861Z Creating ‘aap.cpp.gcov’

Similar lines for the other files with the same name are also in the log, so I imagine that the app.cpp.gcov is being created as expected.

The part where we run the bash upload is a separate job.

I think that’s why you were getting the file errors before. I don’t personally use it, but I believe the gcov tool needs to match the reports against the files to generate the coverage report needed. I would ask if you can take out the -X gcov flag and try running the uploader in a job that has both the reports and source code to see if you still have errors.

The customer opened a support ticket, so marking this resolved.

Will update if this ends up being more then a single-user issue.