which versions are you using (SonarQube - Enterprise Edition v10.6 Sonar-Scanner 5.0.1.3006)
how is SonarQube deployed: zip
what are you trying to achieve - need to upload my coverage files [ lcov.info has been generated using lcov ] for C/C++ source code.
what have you tried so far to achieve this-
Able to generate coverage files[lcov.info along with few .html files] in build workspace. We have used lcov as coverage tool
looks like our sonar analysis and build is success but unable to see the coverage scores in sonarqube. And it shows as 0.0%. not able to see any errors in logs. Have run in debug mode as well.
Have tried all following param/argument in my sonar analysis command. link for reference specified for C/C++ C/C++/Objective-C test coverage
-Dsonar.coverageReportPaths
-Dsonar.cfamily.gcov.reportsPath - for xml
-Dsonar.javascript.lcov.reportPaths → this got to know for type/java scripts
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
All i could see like below in logs
12:20:00.811 INFO: CPD Executor CPD calculation finished (done) | time=49ms
12:20:00.814 INFO: SCM revision ID ‘abfaa9eae69cb9384a72f80af0b699a317249c83’
12:20:00.885 DEBUG: ‘src/persistence/pep.persist.xml’ generated metadata with charset ‘UTF-8’
12:20:00.895 INFO: SCM writing changed lines
12:20:00.897 DEBUG: loading config FileBasedConfig[/home/root/.config/jgit/config]
12:20:00.925 INFO: Merge base sha1: fee8fe7146adce65e227f2e175d586d7eba5b262
12:20:00.927 DEBUG: SCM reported changed lines for 0 files in the branch
12:20:00.927 INFO: SCM writing changed lines (done) | time=32ms
12:20:00.939 INFO: Analysis report generated in 118ms, dir size=334.4 kB
12:20:01.057 INFO: Analysis report compressed in 117ms, zip size=83.4 kB
12:20:01.058 DEBUG: Upload report
12:20:01.114 INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarqube.abc/dashboard?id=XXXX
12:20:01.114 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
12:20:01.114 INFO: More about the report processing at https://sonarqube.abc/api/ce/task?id=
12:20:01.118 DEBUG: Post-jobs :
12:20:01.158 INFO: Analysis total time: 33.396 s
12:20:01.160 INFO: ------------------------------------------------------------------------
12:20:01.160 INFO: EXECUTION SUCCESS
12:20:01.161 INFO: ------------------------------------------------------------------------
12:20:01.161 INFO: Total time: 37.723s
12:20:01.210 INFO: Final Memory: 16M/64M
12:20:01.212 INFO: ------------------------------------------------------------------------
12:20:01.223 DEBUG: Cleanup org.eclipse.jgit.util.FS$FileStoreAttributes$$Lambda$371/0x0000000801317c48@5c9ac4cc during JVM shutdown
What do the logs say about the import of coverage field?
LCOV is not a supported file format for importing test coverage on C/C++ code. Those formats are specified in the documentation you already linked to.
There are also extensive examples in the docs:
In the same GitHub organization, you will also find example repositories that provide guidance on how to add coverage to an already-configured project. These examples do not explicitly describe every possible combination of tooling and platform but do cover the most significant variants. You may need to adapt them slightly:
Here are the logs - We are using lcov as coverage tool. Please check the options we are trying to use and also explored as arguments mentioned in detail above. Coverage files has been generated.
Or can anyone confirm whether we have argument to pass for LCOV coverage tool [ lcov.info as coverage file has been genrated]
024-08-30T12:19:33.8709671Z 12:19:33.870 INFO: ------------- Run sensors on module philips-internal.synergy-base.patient-provider
2024-08-30T12:19:33.9849377Z 12:19:33.984 INFO: Load metrics repository
2024-08-30T12:19:33.9858693Z 12:19:33.985 DEBUG: → GET https://sonarqube.abc/search?ps=500&p=1
2024-08-30T12:19:34.0106448Z 12:19:34.009 DEBUG: ← 200 https://sonarqube.abc/api/metrics/search?ps=500&p=1 (24ms, unknown-length body)
2024-08-30T12:19:34.0182210Z 12:19:34.017 INFO: Load metrics repository (done) | time=33ms
2024-08-30T12:19:34.5703256Z 12:19:34.569 DEBUG: ‘Import external issues report’ skipped because one of the required properties is missing
2024-08-30T12:19:34.5786236Z 12:19:34.577 DEBUG: ‘Python Sensor’ skipped because there is no related file in current project
2024-08-30T12:19:34.5791332Z 12:19:34.578 DEBUG: ‘Cobertura Sensor for Python coverage’ skipped because there is no related file in current project
2024-08-30T12:19:34.5795583Z 12:19:34.579 DEBUG: ‘PythonXUnitSensor’ skipped because there is no related file in current project
2024-08-30T12:19:34.5810066Z 12:19:34.580 DEBUG: ‘Import of Pylint issues’ skipped because there is no related file in current project
2024-08-30T12:19:34.5819511Z 12:19:34.580 DEBUG: ‘Import of Bandit issues’ skipped because there is no related file in current project
2024-08-30T12:19:34.5821077Z 12:19:34.580 DEBUG: ‘Import of Flake8 issues’ skipped because there is no related file in current project
2024-08-30T12:19:34.5822941Z 12:19:34.581 DEBUG: ‘Import of Mypy issues’ skipped because there is no related file in current project
2024-08-30T12:19:34.5824714Z 12:19:34.581 DEBUG: ‘Import of Ruff issues’ skipped because there is no related file in current project
2024-08-30T12:19:34.5830061Z 12:19:34.582 DEBUG: ‘IaC Terraform Sensor’ skipped because there is no related file in current project
2024-08-30T12:19:34.5835870Z 12:19:34.583 DEBUG: ‘IaC CloudFormation Sensor’ skipped because there is no related file in current project
2024-08-30T12:19:34.5841014Z 12:19:34.583 DEBUG: ‘IaC Kubernetes Sensor’ skipped because there is no related file in current project
2024-08-30T12:19:34.5846972Z 12:19:34.584 DEBUG: ‘IaC AzureResourceManager Sensor’ skipped because there is no related file in current project
2024-08-30T12:19:34.5876090Z 12:19:34.587 DEBUG: ‘Generic Test Executions Report’ skipped because one of the required properties is missing
2024-08-30T12:19:34.5889914Z 12:19:34.588 DEBUG: Sensors : XML Sensor → JaCoCo XML Report Importer → Java Config Sensor → IaC Docker Sensor → EnterpriseSecretsSensor → CFamily → TextAndSecretsSensor
2024-08-30T12:19:34.5908689Z 12:19:34.590 INFO: Sensor XML Sensor [xml]
2024-08-30T12:19:34.5912128Z 12:19:34.590 INFO: Sensor XML Sensor is restricted to changed files only
2024-08-30T12:19:34.5925989Z 12:19:34.591 INFO: Sensor XML Sensor [xml] (done) | time=1ms
2024-08-30T12:19:34.5926752Z 12:19:34.592 INFO: Sensor JaCoCo XML Report Importer [jacoco]
2024-08-30T12:19:34.5940358Z 12:19:34.593 INFO: ‘sonar.coverage.jacoco.xmlReportPaths’ is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
2024-08-30T12:19:34.5953874Z 12:19:34.594 INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
2024-08-30T12:19:34.5955143Z 12:19:34.594 INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
2024-08-30T12:19:34.5956326Z 12:19:34.594 INFO: Sensor Java Config Sensor [iac]
2024-08-30T12:19:34.6119422Z 12:19:34.611 INFO: 0 source files to be analyzed
2024-08-30T12:19:34.6254378Z 12:19:34.624 INFO: 0/0 source files have been analyzed
2024-08-30T12:19:34.6262497Z 12:19:34.625 INFO: Sensor Java Config Sensor [iac] (done) | time=31ms
2024-08-30T12:19:34.6263511Z 12:19:34.625 INFO: Sensor IaC Docker Sensor [iac]
2024-08-30T12:19:34.6276710Z 12:19:34.626 INFO: Sensor IaC Docker Sensor is restricted to changed files only
2024-08-30T12:19:34.6373643Z 12:19:34.636 INFO: 0 source files to be analyzed
2024-08-30T12:19:34.7310503Z 12:19:34.730 INFO: 0/0 source files have been analyzed
2024-08-30T12:19:34.7317948Z 12:19:34.731 INFO: Sensor IaC Docker Sensor [iac] (done) | time=105ms
2024-08-30T12:19:34.7319319Z 12:19:34.731 INFO: Sensor EnterpriseSecretsSensor [textenterprise]
2024-08-30T12:19:34.7327160Z 12:19:34.732 INFO: Sensor EnterpriseSecretsSensor is restricted to changed files only
2024-08-30T12:19:34.7335413Z 12:19:34.733 INFO: Available processors: 2
2024-08-30T12:19:34.7336059Z 12:19:34.733 INFO: Using 2 threads for analysis.
2024-08-30T12:19:34.7401266Z 12:19:34.739 INFO: Sensor EnterpriseSecretsSensor [textenterprise] (done) | time=8ms
2024-08-30T12:19:34.7408417Z 12:19:34.740 INFO: Sensor CFamily [cpp]
2024-08-30T12:19:34.7570375Z 12:19:34.756 DEBUG: Total system memory: 7727MB
2024-08-30T12:19:59.7646761Z At the end of the sensor: 53MB , 53MB
2024-08-30T12:19:59.7647891Z Note that these values may not be accurate due to garbage collection; they should only be used to detect significant outliers.
2024-08-30T12:19:59.9412075Z 12:19:59.940 INFO: Sensor CFamily [cpp] (done) | time=25200ms
2024-08-30T12:19:59.9418490Z 12:19:59.940 INFO: Sensor TextAndSecretsSensor [text]
2024-08-30T12:19:59.9420535Z 12:19:59.940 INFO: Sensor TextAndSecretsSensor is restricted to changed files only
2024-08-30T12:19:59.9421423Z 12:19:59.941 INFO: Available processors: 2
2024-08-30T12:19:59.9422044Z 12:19:59.941 INFO: Using 2 threads for analysis.
2024-08-30T12:20:00.4039586Z 12:20:00.403 DEBUG: git --version returned: git version 2.42.0
2024-08-30T12:20:00.4049493Z 12:20:00.404 INFO: Using git CLI to retrieve untracked files
2024-08-30T12:20:00.6684494Z 12:20:00.667 INFO: Analyzing language associated files and files included via “sonar.text.inclusions” that are tracked by git
2024-08-30T12:20:00.6721352Z 12:20:00.671 DEBUG: There are no files to be analyzed
2024-08-30T12:20:00.6727908Z 12:20:00.672 INFO: Sensor TextAndSecretsSensor [text] (done) | time=732ms
2024-08-30T12:20:00.6761225Z 12:20:00.675 INFO: ------------- Run sensors on project
2024-08-30T12:20:00.7078709Z 12:20:00.707 DEBUG: ‘llvm-cov’ skipped because one of the required properties is missing
2024-08-30T12:20:00.7081378Z 12:20:00.707 DEBUG: ‘cppunit’ skipped because one of the required properties is missing
2024-08-30T12:20:00.7091416Z 12:20:00.708 DEBUG: ‘VisualStudioCoverage’ skipped because one of the required properties is missing
2024-08-30T12:20:00.7106944Z 12:20:00.710 DEBUG: ‘bullseye’ skipped because one of the required properties is missing
2024-08-30T12:20:00.7120067Z 12:20:00.710 DEBUG: ‘cobertura’ skipped because one of the required properties is missing
2024-08-30T12:20:00.7126778Z 12:20:00.712 DEBUG: ‘Valgrind’ skipped because one of the required properties is missing
2024-08-30T12:20:00.7128226Z 12:20:00.712 DEBUG: ‘Generic Coverage Report’ skipped because one of the required properties is missing
2024-08-30T12:20:00.7135067Z 12:20:00.712 DEBUG: ‘Import external issues report from SARIF file.’ skipped because one of the required properties is missing
2024-08-30T12:20:00.7136845Z 12:20:00.712 DEBUG: ‘Java CPD Block Indexer’ skipped because there is no related file in current project
2024-08-30T12:20:00.7137936Z 12:20:00.713 DEBUG: Sensors : gcov → Zero Coverage Sensor
2024-08-30T12:20:00.7138587Z 12:20:00.713 INFO: Sensor gcov [cpp]
2024-08-30T12:20:00.7174972Z 12:20:00.717 INFO: Sensor gcov [cpp] (done) | time=4ms
2024-08-30T12:20:00.7175648Z 12:20:00.717 INFO: Sensor Zero Coverage Sensor
2024-08-30T12:20:00.7370972Z 12:20:00.736 INFO: Sensor Zero Coverage Sensor (done) | time=19ms
I think my last post made this all pretty clear: LCOV isn’t supported for importing coverage data on C/C++ files in Sonarqube. You’ll have to (either as a replacement, or in parallel) generate coverage files in a supported format.