How to generate jacoco code coverage reports from jacoco.exec

69 views
Skip to first unread message

Malshani Senarathne

unread,
Nov 8, 2018, 4:05:11 AM11/8/18
to Jenkins JaCoCo plugin mailing list
Hi,

I need to generate the jacoco code coverage reports from the jacoco exec file which I have copied into Jenkins workspace. 

My requirement is to start the server in a remote location, then executes scenario tests against the remote server and get the code coverage. For that purpose, I have placed the jacoco agent in the server side, then attach the jacoco agent as a JVM option and do the instrumentation on the server side. This will automatically generate an empty jacoco exec file in the server side when the server starts up. Then I execute the tests and shutdown the server. Next the generated jacoco exec has copied to jenkins workspace and create a freestyle project. Then added only the exec file in the "Record jacoco coverage report" under "Post-build actions". After that when I triggered a build, I got the results as "Overall coverage: class: 0, method: 0, line: 0, branch: 0, instruction: 0". Could you please help me to get this solved and generate the reports.

I'm using Jenkins 2.138.2 version and jacoco plugin 3.0.4 version. 

Dominik Stadler

unread,
Nov 9, 2018, 4:37:43 AM11/9/18
to jenkins-jacoco-pl...@googlegroups.com
Hi,

it's hard to tell from the description, I would take a look at the full log of the job. It contains information if the exec-file was found and other information from the plugin.

Dominik.


--
Azért kapta ezt az üzenetet, mert feliratkozott a Google Csoportok „Jenkins JaCoCo plugin mailing list” csoportjára.
Az erről a csoportról és az ahhoz kapcsolódó e-mailekről való leiratkozáshoz küldjön egy e-amailt a(z) jenkins-jacoco-plugin-m...@googlegroups.com címre.
Ha üzenetet szeretne küldeni ebbe a csoportba, küldjön e-mailt a(z) jenkins-jacoco-pl...@googlegroups.com címre.
További lehetőségekért látogasson el ide: https://groups.google.com/d/optout.

Malshani Senarathne

unread,
Nov 10, 2018, 11:32:26 AM11/10/18
to jenkins-jacoco-pl...@googlegroups.com, dominik...@gmail.com
Hi,

Please find the  attached images of Jenkins console and configurations. 

image.png

image.png

Also I would like to know whether we can provide the set of .jar files to class directories section and keep the source directions field empty.

Thanks & Regards,
Malshani Senarathne.

Dominik Stadler

unread,
Nov 16, 2018, 12:25:06 PM11/16/18
to pamoda....@gmail.com, jenkins-jacoco-pl...@googlegroups.com
When looking at the code of the plugin and the log-output I don't see any reason why it should not find coverage. Maby the .exec file does not match the classes for some reason?

Dominik.
Reply all
Reply to author
Forward
0 new messages