It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

veronica bykin Sep 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

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

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 Oct 09, 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 Oct 09, 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
veronica bykin Oct 02, 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.

0 votes
Marek Parfianowicz Atlassian Team Oct 09, 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 Oct 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

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Next-gen

Introducing subtasks for breaking down work in next-gen projects

Teams break work down in order to help simplify complex tasks. This is often done iteratively, with tasks being broken down into smaller tasks and so on until the work is accurately captured in well-...

4,632 views 21 23
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you