clover reporting with aggregated/group packages.

Hi,

Is it possible to create report with aggregated package level coverage. For example: I have 100 packages under source dir and wanted to generate report with aggregation/group of selected packages(grouping of releated packages, so that I will get component level report which tells % of coverage at component level)

src: com.xyz.a .....

com.xyz.z

grouping: 1.com.xyz.a to com.xyz.f

2.com.xyz.g to com.xyz.m ...

report:

com.xyz.a to com.xyz.f(af component) 40%

com.xyz.g to com.xyz.m(gm component) 20%

Thanks

3 answers

I did not find any option so far to group selected packages for coverage.

0 vote
You could generate separate reports for every component by defining proper inclusion/exclusion filters. See <clover-setup> / < fileset> for instance.

Hi,

Thanks for the reply. Instead of clover-setup can I exclude them in <clover-report> <fileset <exclude ...

Is there any difference in coverage if I exclude files/packages in clover-report instead of clover-setup?.

thanks

Hi,

Thanks for the reply. Instead of clover-setup can I exclude them in <clover-report> <fileset <exclude ...

Is there any difference in coverage if I exclude files/packages in clover-report instead of clover-setup?.

thanks

If you exclude files in <clover-setup> then they will not be instrumented at all. Which means that they will not be registered in the clover.db. As a consequence they will not be included in the report as well.

If you exclude files in <clover-report> then such files will be instrumented (in <clover-setup>) and will be registered in a clover.db, but they will not be included in the final report.

So as you can see in both cases you will achieve the same.

What's the difference then?

1) There is a difference in case you want to generate several reports with a different content using the same database.

In such case you shall instrument all files (no exclusions in <clover-setup>) and exclude files in <clover-report> calls. Thanks to this, you will not have to recompile the code in order to get different content of reports.

2) There may be also a performance difference if you use exclusions in <clover-setup> - files which are not instrumented will run faster.

Hi,

thanks for information. It is really helpfull.

I have created history point and run history report in the same day.

I am seeing different project stats for both "clover code coverage report" and "Historical coverage report". why these stats are different?. What really history stasts means?. Please let me know?.

ex: Clover Coverage Report statistics for project clover db

stmts:600,100 LOC :2151267 Methods:89940

classes: 11103 NLOC:1212077 Files: 9310

packages:919 TOTAL Coverage :41.4%

Historical coverage Report Project stats: LOC: 2265934 Methods: 94883

NCLOC: 1280188 Classes: 12092

Files: 10033 Packages: 1130

TOTAL: 40.4%

Thanks,

I think this is caused by a fact that a historical report is based on data found in recorded history points. It means that you have to configure proper exclusion patterns for history points as well. See:

https://confluence.atlassian.com/display/CLOVER/clover-historypoint

the <fileset> nested element and the 'filter' attribute (if you use context filters)

thanks a lot! It solved the problem :) Now I am seeing same stats.

I have one more question here..

some new java file(interface) was added newly to src from last build. This new interface(.java) file instrumented(but I did not see any clover specific lables added to this file) and it has only one method def

ex: public interface Abc{

void xyzAbc();

}

It is missing in clover coverage report.

Is this something expected?.

Interfaces(like above ex) won't show up in the clover report even after instrumentation?.

Can you confirm that you new interface has no code in a method body?

I'm asking because, by default, Clover does not show classes or interfaces having no executable code - you can change this behaviour by setting the showEmpty to true.

&lt;clover-report&gt;
  &lt;current&gt;
    &lt;format type="html" showEmpty="true"/&gt;
   &lt;/current&gt;
&lt;/clover-report&gt;

See: clover-report / current / format

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 13 hours ago in Hipchat

Moving from Hipchat to Stride? Here’s what you’ll love

Heya, Hipchat friends! We’re so happy you’re checking out   Stride. Whether you know it or not, you have been instrumental in making Stride come to life. Every feature, design, and functionality...

40 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you