Hello @SaikrishnaBairamoni,
Judging by the SonarCloud logs you’ve attached, the coverage_reports/gcov folder contains no coverage reports for the project files. It contains only reports for two files used by CMake to detect C and C++ compiler features:
INFO: Sensor gcov [cpp]
INFO: Parsing /opt/carma/coverage_reports/gcov/CMakeCCompilerId.c.gcov
WARN: File not analysed by Sonar, so ignoring coverage: /opt/carma/src/CARMAPlatform/stop_controlled_intersection_tactical_plugin/CMakeCCompilerId.c
INFO: Parsing /opt/carma/coverage_reports/gcov/CMakeCXXCompilerId.cpp.gcov
WARN: File not analysed by Sonar, so ignoring coverage: /opt/carma/src/CARMAPlatform/stop_controlled_intersection_tactical_plugin/CMakeCXXCompilerId.cpp
INFO: Sensor gcov [cpp] (done) | time=4ms
Unfortunately, CARMA requires quite an elaborate setup to build and run tests, so I’ll have to rely on you for this. For instance, I failed to find the make_with_coverage.bash file that is invoked in your circleCI script.
Can you make sure that the folder indeed contains the coverage reports? For example, are you running the tests before invoking the Sonar scanner? Perhaps you could list the contents of the directory in your build script right before the scanner runs?
I see. The logs show that our sensor fails to find the coverage reports in the folder. Can you list the files in that folder to make sure the reports are there?
Something like ls -lha "${output_dir}" right before running the sensor. E.g.: this and this
I have listed out the coverage reports folder after the tests are finished and I see couple of gcov files as below:
drwxr-xr-x 2 carma carma 72 Mar 7 18:48 .
drwxr-xr-x 3 carma carma 18 Mar 7 18:12 …
-rw-r–r-- 1 carma carma 199 Mar 7 18:48 CMakeCCompilerId.c.gcov
-rw-r–r-- 1 carma carma 209 Mar 7 18:48 CMakeCXXCompilerId.cpp.gcov
As you can see, the folder contains only two reports for irrelevant files (I believe these are small files CMake uses to test the supported C and C++ compiler features). No report is available for the source files of your project. The issue is likely in the collect_gcovr.bash script, you can check whether it has access to coverage reports and whether it puts them into the right place. Please let me know if you find the issue or if you experience any difficulty debugging it.
I have informed to developers to take a look at gcov bash scripts. I will let you know if we get any issues. Thanks!
I have other ticket created long back and waiting for solution this is for another project regarding the coverage reports, Could you please go through the thread and help me on this. Here is the link to that ticket (Coverage reports is not generating after sonar scan analysis)