SonarQube 4.4 not displaying cobertura unit tests or code coverage for grails 2.4.3 using spock tests

I have SonarQube 4.4 installed on my machine. I am trying to create metrics for a grails project (2.4.3) that has tests written as part of Spock. However, the sonar does not show the results of single tests or the coverage of single tests.

I checked that cobertura coverage.xml gets the generated path given below

targets / test reports / Cobertura / coverage.xml

And I have

sonar.groovy.cobertura.reportPath

in my pom.xml mapped to the above path.

Running

mvn sonar:sonar (maven version 3.2.3)

this project succeeds and the processed coverage is displayed in the console log.

, , , .

.

- groovy -plugin (: 0.5, 0.6 1.0.1) sonar-cobertura-plugin-1.6.3

pom.xml groovy spock

<plugin>
<groupId>org.grails</groupId>
<artifactId>grails-maven-plugin</artifactId>
<version>2.4.3</version>
<configuration>
    <grailsVersion>${grails.version}</grailsVersion>
    <fork>false</fork>
</configuration>
<extensions>true</extensions>
<executions>
    <execution>
        <id>grails-tests</id>
        <phase>test</phase>
        <goals>
            <goal>exec</goal>
        </goals>
        <configuration>
            <command>test-app</command>
            <args>--unit:spock</args>
        </configuration>
    </execution>
</executions>
</plugin>

- sonarqube cobertura?

+4
1

, , . , "sonar.sources" pom.xml . ( )

<sonar.sources>src/java,src/groovy,grails-app/services,grails-app/controllers,grails-app/domain,grails-app/jobs</sonar.sources>
+7

All Articles