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

Disable Clover during runtime on instrumented build

Jan Swaelens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 22, 2012

Hello,

I have several cases where I need to use my instrumented jar to be ran without triggering the Clover functionality, and thus avoiding the need to have Clover on the runtime classpath. I am running these cases from Ant.

Is there a system property that can be flagged for this purpose?

An example of this use case if the GWT compile which we run using <java> in Ant, the runtime is detecting clover and looking for the Clover jar but it makse no sense to be running Clover in the gwtc process.

thanks!

2 answers

1 accepted

0 votes
Answer accepted
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2012

Please have a look at manual showing how to use Clover with Google Web Toolkit: https://confluence.atlassian.com/display/CLOVER/Using+Clover+with+the+GWT-maven+plugin

A manual is for Maven, but for Ant it would be similar, i.e. you have to specify which of your sources contain server-side code and instrument only them - it can be specified in nested <fileset> tag in <clover-setup>. See https://confluence.atlassian.com/display/CLOVER/clover-setup#clover-setup-Fileset.

Regards
Marek

Jan Swaelens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 23, 2012

Thanks, that was exactly what I was looking for.
I now disabled several filesets which don't need instrumentation by using the <fileset> tag in <clover-setup>.

Jan Swaelens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 24, 2012

Bad news, it seems that for some reason instrumentation is still hapening on certain classes (which are Tests actually) causing some mischief when the tests are ran. Is this due to the automatic discovery of tests which are then inavertably instrumented?

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2012

Please note that Clover instrumentation statements are being added to source code and such code is next compiled into classes. As a consequence, it's not possible to omit clover.jar in classpath at runtime.

However, we're currently thinking about adding a feature which would make possibile to disable wrinting coverage data at runtime - CLOV-1119 - feel free to vote on it.

Jan Swaelens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 23, 2012

Thanks, I placed a vote.

I was aware that this approach just doesn't instrument the code as specified by my exclude fileset. This is rather a setup step than runtime direction indeed, but it does the trick for now.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events