Kotlin JUnit tests report is missing

kotlin
sonarqube

(Mike) #1

I am using SonarQube 7.3, Kotlin plugin 1.2.1 (and JaCoCo plugin 1.0.1 if that’s relevant.) I’ve managed to get my project analyzed, I can see coverage, but tests number and report is missing. XML reports are generated by Gradle as expected in /build/test-results/test/TEST-*.xml. Am I missing anything? How should I set it up? Thanks.


(Alexandre Gigleux) #3

Hello Mike,

Nothing is missing on your side. We decided it was not a priority to be able to load the UT results for the moment for Kotlin code, so the feature is not there.

Can you confirm you expect to be able to load JUnit Test Results XML format for your Kotlin project?

Thanks


(Mike) #4

Yes, that’s correct. You’re right it’s not a priority since usually tests must pass anyway to get the build done, but it might be useful to track the number in accordance to some other metric available. Since Java has it and the format is the same, maybe it wouldn’t be that difficult to implement the same for Kotlin.


(Alexandre Gigleux) #5

I agree with you, technically speaking there is no problem because it’s just a matter of removing a constraint to accept all languages and not just Java as it is the case today for the property sonar.junit.reportPaths
Then the question is where do we put this feature? Shall we keep it in SonarJava, I don’t think so. I would prefer this to have this kind of feature coming out of the box with SonarQube, ie not linked to any analyzer.


(Mike) #6

You may be right. Since the file in this format can be used for at least two language it make sense. Either way, currently it is missing when analyzing Kotlin project, that’s why I wrote the post. Not sure I could add anything else. I guess, decision is up to the team how to implement it.