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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.