Jacoco + Kotlin doesn't seem to work

(Melvin Biamont) #1

Hi, I’m trying to calculate the code coverage of my project on SonarCloud.

My project is a multimodule Android project (100% in Kotlin).

I tried to use this property : https://docs.sonarqube.org/display/PLUG/Kotlin+Coverage+Results+Import

But, it doesn’t seem to work. My project is correctly analysed on Sonarcloud, but the code coverage never appears.
I’ve checked the path of my jacoco.xml files, and everything seems to be ok.
It’s like the property sonar.coverage.jacoco.xmlReportPaths isn’t used by SonarCloud.

I don’t understand what I’m doing bad.

Note I was previously using SonarQube 7.1 (on a private server) and the code coverage calculation was working.

(Christophe Zurn) #5

Hello Melvin,

You are not doing anything wrong actually.
The sonar-jacoco plugin that handles coverage reports for Kotlin has not yet been deployed on SonarCloud :sonarcloud:.
However, it has been recently validated for deployment and will be available in a couple of days.

Kind regards

(Qian) #6

Hello Christophe,

Great news, is there anyway we can get updated once the plugin is deployed? We would love to test it right away :slight_smile:

Thank you.

(Christophe Zurn) #7

Hello Qian,

The plugin was deployed yesterday on SonarCloud :sonarcloud:.
However, be aware that there is currently an issue related to mismatched lines between JaCoCo XML reports and SonarQube API causing failure in analysis. (See this discussion for more details Sonar Kotlin Coverage fails due to “Line is out of range” errors)
We’re working on a fix and will deploy it as soon as we can.