Codecoverage percentage is not getting generated and the value shows at 0

We are using Developer Edition Version 9.9.3 (build 79811). We have and Android application which was developed using java and kotlin. Our requirement is to generate a code coverage report and convert it into a format readable by sonarqube so the code coverage percent will be displayed on the project dashboard.
We tried to generate the test report manually and covert into format compatable with sonarqube.
we are unable to see the coverage percent either or Newcode or overall code.

Is anyone facing the similar issue. please help me on this.

Thank you in advance

Hi,

SonarQube natively supports JaCoCo, and our own generic format. What format are your reports in?

 
Ann

It’s in jacoc.
INFO: Sensor PythonXUnitSensor [python] (done) | time=382ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
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
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=4ms
INFO: Sensor Kotlin Sensor [kotlin]
INFO: 277 source files to be analyzed

Hi,

Looks like we’ve found the problem; the report isn’t passed in to analysis.

 
HTH,
Ann

Hi Ann,

Can you please let me know how can we pass this file.

Thank you

Hi,

You’ll need to pass them in with the sonar.coverage.jacoco.xmlReportPaths analysis parameter.

 
HTH,
Ann

Like include it in the sonar-project.properties file or something?

Hi,

How are you analyzing? You should check the docs for your scanner.

 
HTH,
Ann

We are having a docker file for the sonarscanner and running the scan through jenkins pipeline

Hi,

With a Java / Kotlin project, you’re presumably building with Gradle. So you should be analyzing with it too. Specifically, the SonarScanner for Gradle.

 
HTH,
Ann

Hi,
I was still unable to get the report even after changing the project-properties file. What are all the changes that needs to be made.
thanks,

Hi,

Neither the SonarScanner for Gradle, nor the SonarScanner for Maven uses sonar-project.properties.

 
Ann