CodeCoverage is 0 even I could see Scanner importing log

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

I’m using…
SonarQube 9 Community edition.
Gradle
sonar scanner 4.6.2

First I’m afraid I could be rude on my word because I’m not familiar using english. Beg your pardon.

I already successfully runned SonarQube and viewing other measurements.
But only codeCoverage is always 0.

I checked jacoco report xml file exist and Sonar scanner log when sonarqube task.
like below…

[INFO] [org.sonarqube.gradle.SonarQubeTask] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] [org.sonarqube.gradle.SonarQubeTask] Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.
[DEBUG] [org.sonarqube.gradle.SonarQubeTask] Reading report ‘/********/jacoco/jacoco.xml’
[INFO] [org.sonarqube.gradle.SonarQubeTask] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms

I spent a lot of time to find out the reason but it doesn’t made it.

Anyone who give some hint about this problem??

Hi,

Welcome to the community!

Thanks for the warning, but you’re doing just fine. :smiley:

Thanks also for including the analysis log snipped. 2ms is an awfully short time for report reading. Could you double-check that the report isn’t empty?

 
Ann

Thanks to your reply. Ann

I’m late to update this thread.
Recently I solved my problem.
The reasons was classDirectories setting.
I’m using Kotlin. So I should had to include java and Kotlin path all.
But I had added only java class path.

Thanks again.

Thanks for the follow up! I know this will help others in the future!

 
:smiley:
Ann

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.