Must-share information (formatted with Markdown):
- which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension) : Community Edition
- v9.9.6 (build 92038)
- how is SonarQube deployed: zip, Docker, Helm : ?
- what are you trying to achieve : Have code coverage reported
- what have you tried so far to achieve this :
- created sonar task, sonar properties file, setup project in sonar
I have this strange situation
Column 1 | Column 2 | Column 3 |
---|---|---|
Local | master | works |
Local | branch | works |
CI | master | reports 0% coverage |
CI | branch | works |
Edit: I learned this:
we have specified SONAR_USER_HOME as cache folder for Sonar.
During a build in CI sonar is run and it fails to create a .sonarscanner folder and reports 0% coverage on Sonarqube.
BUT if i remove the sonar-javascript-plugin.jar from the SOMAR_USER_HOME/cache folder then it works and reports coverage correctly.
Edit2: It doesn’t work after all. Now that i clear the javascript plugin everytime, it does create a .sonarscanner folder and a reports inside. And it also creates a report task a
{"task":{"id":"someID here ","type":"REPORT","componentId":"Some Id here","componentKey":"our key","componentName":"project name","componentQualifier":"TRK","analysisId":"another id","status":"SUCCESS","submittedAt":"2025-05-15T13:03:04+0000","submitterLogin":"username","startedAt":"2025-05-15T13:03:59+0000","executedAt":"2025-05-15T13:04:40+0000","executionTimeMs":41333,"hasScannerContext":true,"warningCount":1,"warnings":[]}}
But the coverage reported is again 0%.