Search code examples
gradlegroovyjunitsonarqubespock

How do I get SonarQube to count spock/groovy unit tests?


I am trying to configure SonarQube to report an accurate count of the unit test cases in my repository, currently it is only showing the java jUnit test cases.

SonarQube reports the java jUnit test count as well as the overall coverage from jacoco which includes both java and groovy coverage.

How do I get SonarQube to recognize the groovy/spock unit tests in the overall count?

SonarQube 7.7 (I see the issue on 7.4 as well)

I am not sure if there is a specific sonar property I need to set in my Gradle configuration or if there is a plugin in SonarQube itself I need to install?

I do see some related answers about installing the Groovy plugin in SonarQube however there is no mention as to which version of SonarQube this is a solution for (I no longer see this plugin as available)


Solution

  • The marketplace had been missing the Groovy plugin for quite some time. A new version has just been released!

    Simply installing the plugin that is available on the Marketplace solved this problem.

    https://github.com/pmayweg/sonar-groovy