sonarRunner plugin unable to extract information from jacoco plugin output files (test.exec, integrationTest.exec)


(Swarn Dhaliwal) #1

Build time: 2013-08-06 11:19:56 UTC Build number: none Revision: 9a7199efaf72c620b33f9767874f0ebced135d83

Groovy: 1.8.6 Ant: Apache Ant™ version 1.8.4 compiled on May 22 2012 Ivy: 2.2.0 JVM: 1.7.0_09 (Oracle Corporation 23.5-b02) OS: Mac OS X 10.8.4 x86_64

Sonar version : sonar-3.7

running

gradle build sonarRunner has the following output

11:54:57.775 INFO - Analysing /Users/Swarn/Documents/learning/gradle/gradle-in-action-source-master/chapter12/listing_12_14-15-sonar-jacoco/repository/build/jacoco/integrationTest.exec 11:54:57.812 INFO - No information about coverage per test. 11:54:57.813 INFO - Sensor JaCoCoItSensor done: 39 ms 11:54:57.813 INFO - Sensor JaCoCoOverallSensor… 11:54:57.840 INFO - Analysing /Users/Swarn/Documents/learning/gradle/gradle-in-action-source-master/chapter12/listing_12_14-15-sonar-jacoco/build/sonar/com.manning.gia_listing_12_14-15-sonar-jacoco_repository/jacoco-overall.exec 11:54:57.862 INFO - No information about coverage per test. 11:54:57.863 INFO - Sensor JaCoCoOverallSensor done: 50 ms

11:54:59.054 INFO - Analysing /Users/Swarn/Documents/learning/gradle/gradle-in-action-source-master/chapter12/listing_12_14-15-sonar-jacoco/repository/build/jacoco/test.exec 11:54:59.075 INFO - No information about coverage per test.

It seems like sonarRunner plugin is not able to extract information from the output produced by jacoco plugin.

Regards, Swarn


(Peter Niederwieser) #2

I’m not sure what exactly the log message means. This has definitely worked for me. How did you configure the JaCoCo plugin/tasks? What do you see in the Sonar web interface?


(Swarn Dhaliwal) #3

Hi,

Thank you very much for the reply. I am going through the Gradle In Action Book and running these code example is supposed to generate coverage information as there are unit tests as well as integration tests in the project. Running the sonarRunner displays the message.

No information about coverage per test.

and there is no information in the Sonar dashboard.

Regards, Swarn


(Swarn Dhaliwal) #4

Configuration of the jacoco plugin is given below buildscript {

repositories {

mavenCentral()

}

dependencies {

classpath ‘org.ajoberstar:gradle-jacoco:0.3.0’

} }

apply plugin: org.ajoberstar.gradle.jacoco.plugins.JacocoPlugin

jacoco {

integrationTestTaskName = ‘integrationTest’ }


(Benjamin Muschko) #5

I just ran the code example against Sonar 3.5.1 and 3.7 using Gradle 1.7. Both versions display the project as well as the unit test coverage information (keep in mind that for integration test coverage you will need to add another widget).

Did you make any modifications to the example code? Did the build generate any .exec files? Do you see the project in the dashboard at all?


(Swarn Dhaliwal) #6

Hi Benjamin,

Thanks for your help. I think I am good now. I was missing a couple of things which are mostly because of unfamiliarity with Sonar. I did not realize that every time you run the grade build with sonarRunner, it creates a new dashboard in Sonar. I was refreshing the current dashboard and expecting to see the results. Also, I had not added the Integration Widget. After adding the widget and selecting the correct dashboard, everything looks good. The following message in the gradle console No information about coverage per test. was also throwing me off.

By the way, gradle is a wonderful tool and ‘Gradle In Action’ does an excellent job of explaining gradle and software development management in general.

Regards, Swarn


(Hoai Tang) #7

Hi Benjamin,

apply plugin jacoco directly doesn’t work to me with gradle 1.12. No Integration Test Coverage show up in sonar dashboard

apply plugin: “jacoco”

Is the “org.ajoberstar:gradle-jacoco” plugin was integrated into Gradle completely? What is the replacement for integrationTestTaskName = ‘integrationTest’

thanks