Bazel code coverage analysis for C++ showing 0.00 code coverage

Hello Team,

We re using bazel build and Build wrapper for CPP code analysis.
Both build and test commands are passing. However the code coverage is 0.00 in sonar project.

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    We are using SonarQube enterprise edition (8.9.6)
    Sonar Scanner version:

  • what are you trying to achieve
    Goal is to ensure code coverage is showing in SonarQube server

  • what have you tried so far to achieve this
    Following commands were used for build, test and code coverage
    build-wrapper-linux-x86-64 --out-dir build_wrapper_output_directory /home/ubuntu/bin/bazel --batch build --spawn_strategy=standalone --genrule_strategy=standalone …

build-wrapper-linux-x86-64 --out-dir build_wrapper_output_directory /home/ubuntu/bin/bazel --batch test --spawn_strategy=standalone --genrule_strategy=standalone …

sonar-scanner -Dsonar.login=(user token)

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

We are referring to the below cfamily document.

I am little confused that the document only refers to “batch build” and not “batch test”
Is it that the build wrapper also includes both build and test if only build command is used?

(build-wrapper-linux-x86-64 --out-dir build_wrapper_output_directory /home/ubuntu/bin/bazel --batch build --spawn_strategy=standalone --genrule_strategy=standalone …)

Hi Team,
Gentle Reminder, Could you please assist on the above issue at the earliest?