Must-share information (formatted with Markdown):
- which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension) : SonarQube Developer edition 10.2
- how is SonarQube deployed: ZIP
- what are you trying to achieve: Coverage
- what have you tried so far to achieve this: think we have found the issue, just wanted to get confirmation on the behaviour.
Hello Support Team,
I am experiencing an issue where test coverage data is not being displayed in the SonarQube dashboard for a Go workspace project.
I can confirm the SonarQube scan itself completes successfully and all code quality metrics are shown.
I have a few other Go projects where coverage is displayed correctly in SonarQube, so I know the integration works in general. However, for this particular project, I noticed that coverage was missing in the SonarQube UI.
After investigating, I believe the issue is a path mismatch between the file paths in the Go coverage report and the paths SonarQube uses for indexing source files.
To confirm this, I manually updated the coverage report file (after it was generated by the Jenkins agent and before the SonarQube scan started) so that the file paths in the coverage report matched the paths SonarQube uses for indexing. Once I did this, SonarQube was able to display the coverage data in the UI as expected.
Example SonarQube scan log when paths match:
DEBUG 'cmd/app/models/error.go indexed with language 'go'
DEBUG Saving coverage measures for file 'cmd/app/models/error.go'
Example log when there is a mismatch:
WARN File 'app-api/saas/github/provider/client.go' is not included in the project, ignoring coverage
below is example sonar scan log:
DEBUG 'cmd/app/models/error.go indexed with language 'go'
This behavior is also described in the official documentation and blog posts:
Can you please confirm that SonarQube requires the file paths in the coverage report to match the paths it uses for indexing?
If so, is manually updating the coverage report paths before scanning the recommended approach, or is there a better way to handle this for Go workspaces and multi-module projects?
Thanks for your help!