0
votes

I have a Test.java class annotated with @RunWith(SpringJUnit4ClassRunner.class) (from spring-test-3.2.18-RELEASE.jar). I'm finding that it does not show up in Jenkins' Jacoco Coverage Report (or on SonarQube which pulls from Jacoco reports).

Screenshots

Sorry I've had to obfuscate company-secret info, but it's the same class under test I'm showing the coverage data for.

Basic Coverage Report in Jenkins

(screenshots being uploaded shortly)

Jacoco Coverage Report in Jenkins

enter image description here

Further info

1
share the build logs to find the jacoco logs and its executionBarath
Here it is: pastebin.com/TYTgZN7q . I hope my attempts to redact haven't erased key information.Sridhar Sarnobat

1 Answers

0
votes

Yes it does work in SpringJUnitClassRunner.

After trying out the same code on my local machine with Java 8 (instead of Java 7) and a (probably) simpler execution scope, and with the following version:

jacoco {
    toolVersion = "0.7.6.201602180812"

I found that the class that wasn't getting executed on Jenkins does work. So there must be something about the Jenkins environment that is different.