SonarQube + Jenkins not producing Unit Tests Coverage

51 views
Skip to first unread message

hu.j...@gmail.com

unread,
Feb 22, 2017, 10:05:30 PM2/22/17
to SonarQube

I have Jenkins v1.651.1 and SonarQube Runner 2.4 and SonarQube Server 4.5.2.

The Jenkins job runs mvn clean test to generate the .exec report. My analysis properties (part of the Jenkins build) look something like this:

sonar.sources=myproj

sonar.tests=myproj/runtime/src/test

sonar.language=java

sonar.java.test.binaries=myproj/runtime/target/test-classes
sonar.java.test.libraries=myproj/runtime/target/admin/WEB-INF/lib/*.jar
sonar.java.binaries=myproj/runtime/target/classes
sonar.java.libraries=myproj/runtime/target/admin/WEB-INF/lib/*.jar
sonar.java.source=1.8
sonar.java.coveragePlugin=jacoco

sonar.sourceEncoding=UTF-8

sonar.jacoco.reportPath=myproj/target/jacoco.exec

sonar.junit.reportsPath=myproj/runtime/target/surefire-reports

The job completes successfully, but my Sonar dashboard looks like this and the job can't find the class files:

02:35:52.170 INFO  - Sensor JaCoCoItSensor...
02:35:52.171 INFO  - No JaCoCo analysis of project coverage can be done since there is no class files.
02:35:52.172 INFO  - Sensor JaCoCoItSensor done: 2 ms
02:35:52.172 INFO  - Sensor JaCoCoOverallSensor...
02:35:52.172 INFO  - Sensor JaCoCoOverallSensor done: 0 ms
02:35:52.172 INFO  - Sensor JaCoCoSensor...
02:35:52.172 INFO  - No JaCoCo analysis of project coverage can be done since there is no class files.
02:35:52.172 INFO  - Sensor JaCoCoSensor done: 0 ms
02:35:52.172 INFO  - Sensor CPD Sensor (wrapped)...
02:35:52.172 INFO  - JavaCpdEngine is used for java

Before marking as duplicate, please note that I've tried to set sonar.java.binaries.

I've also verified that the .exec file is there and when opening locally has the coverage values that I expect. Please help! Thanks.


Copied and pasted from http://stackoverflow.com/questions/42406185/sonarqube-jenkins-not-producing-unit-tests-coverage.

G. Ann Campbell

unread,
Feb 23, 2017, 8:14:24 AM2/23/17
to SonarQube, hu.j...@gmail.com
Hi,

Please don't cross-post here and on Stackoverflow. Both channels are are monitored by communities with a very large overlap between them. In other words, you've just take twice your share of mental bandwidth.


Ann

hu.j...@gmail.com

unread,
Feb 23, 2017, 1:12:24 PM2/23/17
to SonarQube, hu.j...@gmail.com
Oops, sorry!
Reply all
Reply to author
Forward
0 new messages