How to merge code coverage reports from multiple target devices? (Android, jacoco)

2,100 views
Skip to first unread message

mbwarr...@gmail.com

unread,
Feb 15, 2016, 3:25:06 AM2/15/16
to JaCoCo and EclEmma Users
Hi,

I have a device farm where I run my tests on. Everything works but the code coverage differs nearly every time because only the last coverage report from a device is used. Based on the Android version on the device, the coverage might differ.

I read about jacoco merge but all I can find are "multi project" samples but no sample where I could see how I could merge the coverage.ec files the jacoco plugin downloads from the devices.

Any idea?

Marc R. Hoffmann

unread,
Feb 15, 2016, 3:29:35 AM2/15/16
to jac...@googlegroups.com
Hi,

what "jacoco plugin" do you refer to? We provide Ant task and and Maven
goal for merging:

http://eclemma.org/jacoco/trunk/doc/ant.html#merge
http://eclemma.org/jacoco/trunk/doc/merge-mojo.html

Alternatively you might simply concatenate exec files. The report
generator will the consider probes from all sessions.

Regards,
-marc

Martin Breuer

unread,
Feb 15, 2016, 3:42:14 AM2/15/16
to JaCoCo and EclEmma Users
Thanks for the fast response.

I talk about the jacoco plugin which is bundled in Gradle: https://docs.gradle.org/current/userguide/jacoco_plugin.html

When I run my jacoco coverage, each device (in my case up to 14) are used to run the tests on.
Whenever a device is done, the plugin pulls the coverage.ec file from the device and stores in it my build/outputs/code-coverage/coverage.ec file.
If another device is done, it does the same but overwrites the previously pulled file.
That means that only the last of 14 devices is used to create the coverage report.

Something that could help me is a way to give the coverage.ec a unique name so that they don't overwrite each other. Is that somehow possible?

I now I might have to ask at some gradle support community as well, but I just want to make sure that I didn't miss some configuration on the jacoco part.

Marc R. Hoffmann

unread,
Feb 15, 2016, 4:05:10 AM2/15/16
to jac...@googlegroups.com
Hi,

with JaCoCo itself different solutions are possible:

- append existing exec file instead of overwriting it (append option)
- give arbitrary names to written exec files (destfile option)

As you said you might better check with the maintainer of the Gradle plug-in.

Regards,
-marc
--
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/d7195601-cdc9-40e0-beb7-2ee9ed6aa14c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


saveliyz...@gmail.com

unread,
Aug 11, 2016, 7:04:15 AM8/11/16
to JaCoCo and EclEmma Users
Hi Martin,

Did you find a solution?

Martin Breuer

unread,
Aug 11, 2016, 7:10:08 AM8/11/16
to jac...@googlegroups.com
Sadly nothing I tried worked out :(

--
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/vwb-FpdBTe8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/4890c6eb-50a0-4da0-92fe-ab947f2c87a6%40googlegroups.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages