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:

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? Testing with Docker
Testing with Tox? Python
project root: .
./codecov.sh: line 887: hg: command not found
Yaml not found, that’s ok! Learn more at About the Codecov YAML
==> gcov disabled
==> Python coveragepy not found
==> Searching for coverage reports in:
+ .
→ No coverage report found.
Please visit Codecov uploader and 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.

I would like to surface that this not a single-user issue. I got affected by it as well.

Private repository, so only general details:

  • I tried a lot of path fixes, but it didn’t help me with missing files (mentioned in generated reports, but missing in the Codecov UI)

  • all reports were correctly discovered by the Codecov Github action and uploaded without errors

  • all files in the git repository were correctly listed in the network section of the uploaded report

  • I had several files with different paths, but coinciding names, for example:

    • projectA/src/main/scala/foo.scala vs.
    • projectB/src/main/scala/foo.scala

    or

    • projectC/src/main/scala/bar.scala vs.
    • projectC/src/test/scala/bar.scala (notice that this is test, it’s not a subject for the coverage reports)
  • all of these files were ignored (not one of the two, but both)

  • after I renamed them all with different names, they appeared in the UI and coverage reports

Hi @laughedelic, can you provide a commit SHA?

Hi @tom. Unfortunately, the project is in a private repository.

Are you able to DM me a recent commit SHA so that we can investigate?