Sonar scan running from different file path than coverage report

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    sonar-scan-cli 4.6.x
  • what are you trying to achieve
    send coverage report metrics to SonarQube
  • what have you tried so far to achieve this
    Tried an alternative analysis location properties but that doesn’t seem to work.

As I build a container I also run unit tests with coverage. That creates a PHP coverage report with a specific file path inside the container.

This build is also being run inside a Jenkins build job with a Jenkins workspace. The scanner starts against that checkout of the project inside the Jenkins workspace.

I am unsure how to rectify the scanner saying that the filepaths in the coverage report file do not match the files scanned in the Jenkins build job workspace.

Any help would be greatly appreciated.

Hi @avelis and welcome to the community.

This is a known issue (see this thread) and we are about to provide a fix/solution soon.


1 Like