Two files flagged up in scan results and coverage not being reported

INFO: Importing /github/workspace/clover.xml

[141](https://github.com/RCheesley/mautic/runs/7638207286?check_suite_focus=true#step:12:142)WARN: Failed to resolve 2 file path(s) in PHPUnit coverage clover.xml report. Nothing is imported related to file(s): /github/workspace//app/bundles/CoreBundle/Helper/EmojiMap/UnicodeToHtmlEmojiMap.php;/github/workspace//app/bundles/CoreBundle/Templating/Helper/MautibotHelper.php

Hi folks!

Struggling to get the code coverage report (from Codecov) to be used in the SonarCloud scan correctly - this error is being thrown in the logs (check the actions log: Sonarcloud scan · RCheesley/mautic@eef7501 · GitHub).

The PR is here: Mautic sonar by RCheesley · Pull Request #13 · RCheesley/mautic · GitHub

Working on the guidance in this post: How to use SonarCloud with a forked repository on GitHub? - #34 by RCheesley to get it working on forked PRs.

I’m going to take a guess (without seeing the actual coverage report) and say that SonarCloud doesn’t like the double / in the file paths (//app/). Do other files in the coverage report have this as well?

It’s a bit strange because the log literally just highlights those two files - nothing else. I would have expected to have a giant list of every PHP file if there was a syntax error?

Which is why I would check this:

Sorry I thought I had explained that it only seems to be affecting these two files, from what I can tell from the output:

however I am very new to Sonar and relatively new to creating GitHub Actions!

My point is really the coverage report that is being produced in previous steps (the clover.xml file ultimately being imported). Does that file contain the odd file paths (with the // oddity) or only those two files?

Ahh, gotcha!

Here is the file:

code-coverage-report (1).zip (544.6 KB)

Seems to be as expected, cannot see any reference to the //app path in the file?

Is that file from before or after the sed command in your action manipulates it?

I downloaded that file from the GitHub Actions workflow where it is generated. The sed command moves it into the container as otherwise it was not getting picked up at all (ref this thread: Code coverage doesn't work with GitHub action - #7 by sylfabre)

I am not sure how to grab the actual file from that stage in the workflow - it was working in a run I did before:

Re_ RCheesley_mautic Mautic sonar (PR #13) - ruth.cheesley@acquia.com - Acquia, Inc. Mail

However that was covering the whole repo rather than just the changes in this PR - when I fixed the scm setting (ref: How to start the scanner from now and not pick up all existing issues? - #8 by RCheesley) it seemed to stop working (can’t seem to find historical runs in the SonarCloud IU).