New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When Clover is disabled eliminate recompilation of sources during test task execution #112
Comments
Are you sure you set this correctly? It has been tested and it works.
or
|
I retested this in a single project as well as a multiproject configuration. Both report Clover disabled and do not apply instrumentation. The test I used was a simple build we have to run functional tests with. The build.gradle file for this is here: disabled-instrumentation For reference this is the output I receive when running the multiproject configuration:
|
Thanks for testing it !! Where do I find the referenced deps.gradle? I tried a search on the repo but it didn't find it. I'll give my code another try and see if I can narrow down my issue. |
Umm, it is there as ../deps.gradle. It is not that hard to find. |
Sorry not sure why I didn't find it ! So I tried and though it claims it is disabled I still get output and the classes get recompiled: Shouldn't it exit before loading up the openClover jar file?
|
My junit tests also start failing due to the re-compilation. For now I have a work around I just push the clover stuff to a apply file and do something like: if (cloverEnabled.toBoolean()) { Thanks for the work on this plugin ! |
Yea, the classes are recompiled but without instrumentation. Your workaround disables the plugin completely and solves the issue. Perhaps we can allow for the instrumentation to be disabled by not adding the task action on the test task. I will take this on as an enhancement. With this plugin we do not need to be coupled so closely to the underlying library facilities. I can see how we may be able to let the plugin do the right thing instead of disabling the Clover instrumentation while everything else is still invoked. |
I think all you'd need for this is : Line 64: if (cloverPluginConvention.enabled) { |
Thanks, but it is a bit more complex than that. Perhaps the best approach is to disable the tasks instead of removing them. Your suggestion would work in the general case but in many environments such an approach would break an automated build should the option to enable was turned off. I will spend some time thinking about the best approach to make this happen. I think if I were to just disable the injected actions in configureActions we would get the desired effect.
|
Good point. Thanks for looking at it. |
…urces during test task execution This change eliminated the injected task actions for Test task type when `enabled` flag is set to false. Previously we simply relied to the OpenClover closer-setup Ant task enabled flag to disable instrumentation but we also caused the recompilation of the classes when the enabled==false. With this change there is no action and classes are compiled only once.
…urces during test task execution This change eliminated the injected task actions for Test task type when `enabled` flag is set to false. Previously we simply relied to the OpenClover closer-setup Ant task enabled flag to disable instrumentation but we also caused the recompilation of the classes when the enabled==false. With this change there is no action and classes are compiled only once.
I tried the enabled = false but that just turns off the generation of the clover reports. The instrumentation still occurs.
The text was updated successfully, but these errors were encountered: