Merging coverage reports

775 views
Skip to first unread message

mariam...@west.cmu.edu

unread,
Oct 24, 2013, 10:42:47 PM10/24/13
to jac...@googlegroups.com
Hi All,

I'm running multiple sets of test cases on a single package. As expected, after running Jacoco , it generates an individual report for each set. However I would like to find a way to aggregate the generated report files, in that I can have a final report including the coverage percentage for all of the test cases, so that I can tell which test case has a better coverage for the package. Is there any way that I can do this?

Thanks in advance

Marc R. Hoffmann

unread,
Oct 25, 2013, 1:23:42 AM10/25/13
to jac...@googlegroups.com
Hi,

you have two options:

1) Generate a separate report for every exec file: Here you see the code
coverage for every test file in separate reports
2) Merge all exec files and create a single report: Here you see the
total coverage in a single report

What ist not supported is to create a single report which still shows
different coverage figures for different exec files.

Best regards,
-marc
Message has been deleted

mariam...@west.cmu.edu

unread,
Oct 25, 2013, 3:54:09 AM10/25/13
to jac...@googlegroups.com
Thanks for your prompt response Marc
So based on your response, if we run both test case A, and test case B on package P, there is no way that we can display their coverage figures in two different columns of one report next to each other?


If that' what you mean, could you clarify if at least there is any way that we can use the Jacoco API to generate such as report by a little bit of programming?\

Marc Hoffmann

unread,
Oct 25, 2013, 5:39:23 AM10/25/13
to jac...@googlegroups.com
> there is no way that we can display their coverage
> figures in two different columns of one report next to each other.

No, this is not supported by JaCoCo reporting.

> If that' what you mean, could you clarify if there is any way that we
> can use the Jacoco API to generate such as report?

Of course! You can use JaCoCo core APIs to analyze A and B separately
and then create your on reports based on this data structure.

Cheers,
-marc


On 2013-10-25 09:51, mariam...@west.cmu.edu wrote:
> Thanks for your prompt response Marc
>
> So based on your response, if we run both test case A, and test case B
> on package P, there is no way that we can display their coverage
> figures in two different columns of one report next to each other.
>
>
> If that' what you mean, could you clarify if there is any way that we
> can use the Jacoco API to generate such as report?
>
>
>
>
>
> On Thursday, October 24, 2013 10:23:42 PM UTC-7, Marc R. Hoffmann
> wrote:

rupert....@gmail.com

unread,
Nov 28, 2013, 12:46:48 AM11/28/13
to jac...@googlegroups.com
On Friday, October 25, 2013 11:39:23 AM UTC+2, Marc R. Hoffmann wrote:
> > there is no way that we can display their coverage
>
> > figures in two different columns of one report next to each other.
>
>
>
> No, this is not supported by JaCoCo reporting.
>
>
>
> > If that' what you mean, could you clarify if there is any way that we
>
> > can use the Jacoco API to generate such as report?
>
>
>
> Of course! You can use JaCoCo core APIs to analyze A and B separately
>
> and then create your on reports based on this data structure.
>
>
>

to solve this problem we currently look into http://www.sonarqube.org/, which seems to use this jacoco feature.

rupert

Mani Sarkar

unread,
Dec 25, 2014, 10:04:39 AM12/25/14
to jac...@googlegroups.com, mariam...@west.cmu.edu
It still would be nice to be able to plug into JaCoCo's report runner and re-analyse the merged .exec files during the analysis or offline. Has anyone done any maven or Java work on this?

I know there was a pull request created with this feature long ago but not sure what happened to the feature if it found its way into JaCoCo, see https://github.com/jacoco/jacoco/pull/97.

Honestly I think the append property is partially useful, as it helps merge the exec files but not update the reports to reflect just that?

Any other ideas to merge it will be great, I did see the one where Ant tasks are used but I find it too verbose for a pom.xml file.

Mariam Rajabi

unread,
Dec 25, 2014, 2:48:47 PM12/25/14
to Mani Sarkar, jac...@googlegroups.com
Hi Mani,

I have this project on GitHub which generates a comparison report for two .exec files. https://github.com/mariamr/Jacoco-Comparison-Tool
I think you can extend/modify it to do more analysis on exec files.

Mariam

Mani Sarkar

unread,
Dec 25, 2014, 3:14:16 PM12/25/14
to Mariam Rajabi, jac...@googlegroups.com
Thanks for the tip - i'm still looking for something that combines reports as well.
--
@theNeomatrix369  |  Blog  |  LJC Associate & LJC Advocate (@adoptopenjdk & @adoptajsr programs)
Meet-a-Project - MutabilityDetector  |  Bitbucket  |  Github  |  LinkedIn
Come to Devoxx UK 2015: http://www.devoxx.co.uk/

Don't chase success, rather aim for "Excellence", and success will come chasing after you!

Mariam Rajabi

unread,
Dec 25, 2014, 4:28:25 PM12/25/14
to Mani Sarkar, jac...@googlegroups.com
Oh this thing compares two exec files and shows their associated reports side by side, if that's what you mean by combining reports.

Mani Sarkar

unread,
Dec 25, 2014, 6:10:10 PM12/25/14
to Mariam Rajabi, jac...@googlegroups.com
By combining reports i mean merging all .exec files into one .exec file and then producing an overall report from that file.

anich...@gmail.com

unread,
May 26, 2015, 2:51:55 AM5/26/15
to jac...@googlegroups.com, sadh...@gmail.com, mariam...@west.cmu.edu
Hi,
I wanted to use Jacoco-Comparison-Tool, I followed given instructions but I was not able to generate comparison report. While executing report.sh it thrown exception, can you please take a look into it. Following is the link to issue I am facing.
https://github.com/mariamr/Jacoco-Comparison-Tool/issues/1

Can anyone please take a look into this issue and post an example.
Thanks in advance.

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages