Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

clover reporting with aggregated/group packages.

niv July 15, 2014

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

0 votes
niv August 4, 2014

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?.

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 4, 2014

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.

<clover-report>
  <current>
    <format type="html" showEmpty="true"/>
   </current>
</clover-report>

See: clover-report / current / format

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 17, 2014
You could generate separate reports for every component by defining proper inclusion/exclusion filters. See <clover-setup> / < fileset> for instance.
niv July 28, 2014

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

niv July 28, 2014

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

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 29, 2014

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.

niv July 31, 2014

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,

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 3, 2014

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)

0 votes
niv July 16, 2014

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events