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?
TIA, G
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.
Cheers
Marek
See also:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Marek. A Few comments:
Thanks again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.