Multiple steps on a relatively large code base

We have been using Clover driven by ant on a Jenkins build for quite some time now. The code base has grown and it's relatively large: roughly 500K NCLOC, 8500 files, 9000 classes, 8500 unit tests, 1700 acceptance/integration tests. The Jenkins build runs at night and it's quite resource intensive: for example, it requires 3 GB of memory to both compile and run all the tests.

We are wondering whether we can split this in multiple steps, so that the memory requirements are smaller, but all the data is still collected as it was run in one step and the historical reports work in the same way.

Can anybody shed some light and provide some guidance about this?


1 answer

1 accepted

1 vote

Hi Bob,

There are at least few possibilities:

1) You can split your project into several smaller modules. Instrument, compile and test them separately. Each of them will have it's own <clover-setup/> task and multiple clover.db files will be produced. After the build merge all databases using <clover-merge/> task in order to have a single Clover report.

2) You can define <fileset includes="..." excludes="..."> for <clover-setup/> and measure code coverage for most important code areas only. I recommend to exclude all generated code from instrumentation.

3) You can disable per-test code coverage (if you don't need such detail) recording. Thanks to this no clover.db*.s files will be produced (I guess that you have at least 10'000 of such files produced).

How to do this: in the <clover-setup> define that there are no test sources, e.g. <testsources dir=".." excludes="\*\*">

Main drawback: test results will not be collected by Clover so in the HTML report you have to add them manually (<clover-report>...<testresults>).

4) You can disable per-test coverage syntax highlighting in HTML report (it's disabled by default) - see <clover-report> ... <current showUniqueCoverage="false">. Clover will consume much less memory.

5) You can reduce instrumentation level from "statement" to "method" - see <clover-setup instrumentationLevel="method">. Main drawback is the much lower accuracy of course.


Thanks Marek. A Few comments:

  1. clover-merge is probably our best option
  2. we don't have much generated code, so it wouldn't make much of a difference
  3. we like the idea of having all the details
  4. I may play with this
  5. we prefer to work at the statement level

Thanks again!

Suggest an answer

Log in or Join to answer
Community showcase
Emilee Spencer
Published yesterday in Marketplace Apps

Marketplace Spotlight: DeepAffects

Hello Atlassian Community! My name is Emilee, and I’m a Product Marketing Manager for the Marketplace team. Starting with this post, I'm kicking off a monthly series of Spotlights to highlight Ma...

44 views 0 3
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot