I moved my job from a single Hudson machine to a multi-slave Jenkins environment, and now JaCoCo coverage no longer works.
WORKING (old): Hudson 2.0.1, Jenkins Sonar Plugin 1.7.1, Sonar 2.1.2
BROKEN (new): Jenkins 1.446, Jenkins Sonar Plugin 1.7.2, Sonar 2.1.2
My Hudson job is called Pinnacle and it used to run on a single Hudson server with Sonar on the same machine. I set up my (NO MAVEN) build by doing the following.
1) Added an Ant target to my build.xml called test-with-coverage
2) Configured the Pinnacle job in Hudson to "invoke standalone Sonar Analysis" with these properties:
sonar.projectKey=com.skyboximaging:pinnacle
sonar.projectName="Pinnacle"
sonar.projectVersion=1.0
sources=Pinnacle/src/java
tests=Pinnacle/test/java
binaries=Pinnacle/classes
sonar.jacoco.reportPath=Pinnacle/jacoco.exec
sonar.jacoco.antTargets=test-with-coverage
(Note that the code is checked out into Pinnacle directory in the Jenkins job workspace.)
3) Configured Sonar "general settings" to use JaCoCo for code coverage
Everything worked beautifully!
But in the new Jenkins environment, I see this error in the Jenkins build output:
23:15:17.863 INFO Sensor JaCoCoSensor...
23:15:17.868 INFO Project coverage is set to 0% as no JaCoCo execution data has been dumped: /var/lib/jenkins/workspace/Pinnacle/Pinnacle/jacoco.exec
That file does not exist on the slave where the build ran. (The directory /var/lib/jenkins/workspace/Pinnacle/Pinnacle does exist.)
All other sensors (FindBugs, PMD, etc) appear to be working OK. Just JaCoCo is broken.
Does Sonar/JaCoCo even work in a multi-slave Jenkins environment?
I suspect that the Ant task test-with-coverage
is not getting run. How does Sonar locate the build.xml? And what is different between old and new installations?