Code coverage from bazel

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension): Data center Edition v2025.1.2

  • how is SonarQube deployed: part of CI/CD

  • what are you trying to achieve:
    I am using bazel as my build environment and I could see the coverage report getting generated. I am giving this lcov report to the sonarqube but the code coverage is still 0.0%.
    I am using autoconfig c/c++ to run analysis. In the raw logs I could see a statement “Parsing /coverage.lcov”. But I dont see coverage getting posted.

    Below lines are from raw logs:

Sensor llvm-cov [cpp]
Parsing /coverage.lcov

Sensor llvm-cov [cpp] (done) | time=137ms

Hi,

Could you add -Dsonar.verbose=true to your analysis command line and provide the resulting 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.

 
Thx,
Ann

Hello @ganncamp ,

thank you for your reply. I am not sure if I can share logs here in a public chat. Can I send it to your email?

Hi,

Feel free to redact as necessary.

 
Ann

Hello @ganncamp ,

Is it possible for you to start a private thread where I can share the logs?

Hi,

Just redact the sensitive stuff & go ahead & post.

 
Ann