Zero Coverage in CI

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%.

Hi,

Welcome to the community!

Only the latest version of SonarQube Community Build is considered active, so you’ll need to upgrade and see if the situation is still replicable before we can help you.

Your upgrade path is:

9.9.6 → 24.12 → 25.5

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

Regarding your question, this is likely a problem with a path mismatch in the coverage report between what SonarQube sees during analysis and the file paths in the coverage report. If you’re still seeing the problem after your upgrade, come back to us with your full analysis log.

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Ann