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

How do I disable Clover during test runs using the Gradle plugin and what is the command line to enable it?

veronica bykin September 25, 2013

It slows down the test runs quite a bit, so we just want to run it on CI (Jenkins). I can't find any doc about how to set this option.

3 answers

1 vote
jjaroczynski
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.
October 2, 2013

Hello Veronica,

Once the sources are compiled and instrumented there is no option to disable Clover code coverage at runtime. You can control some aspects of coverage recording though.

If possible I would suggest to disable Clover instrumentation/integration in some of your builds if you are not interested in coverage and enable only for specific builds.

Please also read the performance tuning spec: https://confluence.atlassian.com/display/CLOVER/Clover+Performance+Tuning

Cheers,
Jacek

jjaroczynski
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.
October 6, 2013

Actually there is an option to disable gathering coverage: -Dclover.enable=false

It should improve the performance but Clover classess and some overhead is still there.

I'm sorry for the confusion.

Cheers,
Jacek

veronica bykin October 9, 2013

Hi Jacek, thanks for your advice. I'm not sure what you mean here:

"If possible I would suggest to disable Clover instrumentation/integration in some of your builds if you are not interested in coverage and enable only for specific builds."

Could you elaborate?

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2013

Hi Veronica,

The point is that if you have an application instrumented by Clover, then for every statement in your code there is one call of the coverage recorder's method. This method call is present in the compiled bytecode.

It means that even if you disable coverage recording using -Dclover.enable=false, then this method is still called - method does nothing in such case, but the call itself still adds some microseconds of overhead.

That's why in order to achieve maximum performance during tests, it's better to recompile the whole appliation without Clover rather than using -Dclover.enable switch.

Cheers
Marek

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2013

Are you using Clover integration with Gradle as described on the http://gradle.codehaus.org/Cookbook#Cookbook-usingClover page? If yes, then the -PwithClover commandline option enables Clover.

veronica bykin October 13, 2013

No, we are not using the Cookbook. We are using this plugin:

https://github.com/bmuschko/gradle-clover-plugin

We figured out that in our environment we just have to add our own system property check, e.g.:

clover {
if (System.getProperty('clover.enable') != 'true') {
excludeTasks = ['test']
}
}

Thanks for your help!

-Veronica

0 votes
veronica bykin October 2, 2013

I need to set it up disabled by default because it slows down some of the builds and not everyone will be interested in the reports.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events