Kostis Kapelonis (53) [Avatar] Offline
It has come to my attention via this stackoveflow question that in the recent versions of SonarQube, if a project has both JUnit and Spock tests, only the JUnit ones are shown.


Code coverage is calculated correctly (for both types of tests) and shown accordingly so nothing is broken regarding this aspect. It would be good however to be able to inspect Spock tests as well via the SonarQube interface.

The solution to the problem involves the following two steps:

1. Install the Groovy plugin in Sonar. Login as admin/admin and go to the administration/system/update-center tab

2. Add the following property in the pom file


After the next SonarQube run (mvn sonar:sonar) both types of tests will appear correctly.
(See attached image)