jacocoTestReport not generated on Jenkins

455 views
Skip to first unread message

Girish Bhat

unread,
May 11, 2021, 11:16:49 AM5/11/21
to JaCoCo and EclEmma Users
Hi All,

I am working on code coverage on Gradle build..I tried locally it was working and generating all necessary files like .exec, .xml but when on Jenkins pipeline not generating any files...

Today I downloaded the Jenkins artifacts just to make sure that the reports folder present or not, and I found that it’s not. below is the dir structure…

for reference attaching all screen shots:
dir of Jenkins Artifacts..
Screenshot 2021-05-11 at 6.18.21 PM.png

Below Screenshot of running locally using the command  "./gradlew clean jacocoTestReport sonarqube"

Screenshot 2021-05-11 at 7.34.39 PM.png


This is how the task is defined in app/build.gradle file

task jacocoTestReport(type: JacocoReport, dependsOn: [‘testProdReleaseUnitTest’]) {
reports { 
xml.enabled = true 
html.enabled = true 
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', 'android/**/*.*'] 
def debugTree = fileTree(dir: "${buildDir}/intermediates/javac/prodRelease/classes", excludes: fileFilter) 
def mainSrc = "${project.projectDir}/src/main/java" getSourceDirectories().setFrom(files([mainSrc])) getClassDirectories().setFrom(files([debugTree])) getExecutionData().setFrom(fileTree(dir: "$buildDir", includes: ["jacoco/testProdReleaseUnitTest.exec"]))

}




Marc Hoffmann

unread,
May 11, 2021, 11:35:32 AM5/11/21
to JaCoCo and EclEmma Users
Hi,

please note that the Grade plugin is not maintained by us. See our integration matrix:


Please contact the Gradle project for support.

In general the build log should give you an idea what may go wrong on the Jenkins server.

Regards,
-marc


On 11. May 2021, at 17:16, Girish Bhat <gbh...@gmail.com> wrote:

Hi All,

I am working on code coverage on Gradle build..I tried locally it was working and generating all necessary files like .exec, .xml but when on Jenkins pipeline not generating any files...

Today I downloaded the Jenkins artifacts just to make sure that the reports folder present or not, and I found that it’s not. below is the dir structure…

for reference attaching all screen shots:
dir of Jenkins Artifacts..

<Screenshot 2021-05-11 at 6.18.21 PM.png>

Below Screenshot of running locally using the command  "./gradlew clean jacocoTestReport sonarqube"

<Screenshot 2021-05-11 at 7.34.39 PM.png>


This is how the task is defined in app/build.gradle file

task jacocoTestReport(type: JacocoReport, dependsOn: [‘testProdReleaseUnitTest’]) {
reports { 
xml.enabled = true 
html.enabled = true 
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', 'android/**/*.*'] 
def debugTree = fileTree(dir: "${buildDir}/intermediates/javac/prodRelease/classes", excludes: fileFilter) 
def mainSrc = "${project.projectDir}/src/main/java" getSourceDirectories().setFrom(files([mainSrc])) getClassDirectories().setFrom(files([debugTree])) getExecutionData().setFrom(fileTree(dir: "$buildDir", includes: ["jacoco/testProdReleaseUnitTest.exec"]))

}






--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/e110719c-a6a9-40e5-bbf3-f6116a053152n%40googlegroups.com.
<Screenshot 2021-05-11 at 6.18.21 PM.png><Screenshot 2021-05-11 at 7.34.39 PM.png>

Girish Bhat

unread,
May 11, 2021, 12:21:03 PM5/11/21
to jac...@googlegroups.com
How is this gradle issue when l run locally it is generating all the .exec,.xml files.

Regards,
Girish Bhat


You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/aj3n-p9ML5M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/F0AABA4F-1323-4C5F-80C9-18C2F255BD73%40mountainminds.com.

Evgeny Mandrikov

unread,
May 11, 2021, 12:31:05 PM5/11/21
to JaCoCo and EclEmma Users
On Tuesday, May 11, 2021 at 6:21:03 PM UTC+2 Girish Bhat wrote:
How is this gradle issue when l run locally it is generating all the .exec,.xml files.

And how this can be JaCoCo issue if you run locally and it works?

If it works locally, then the issue is likely in your Jenkins pipeline/setup about which we also obviously do not not know much and can only advice what was already said by Marc:

Thilaknath Ashokkumar

unread,
Aug 26, 2021, 2:12:53 PM8/26/21
to JaCoCo and EclEmma Users
Girish where you able to resolve the issue? In our case we are seeing a strange behavior were the .xml report does not get generated correctly just within the container
Reply all
Reply to author
Forward
0 new messages