Closed Zorobay closed 2 years ago
If you could create an example that can reproduce this failure perhaps I could try to find out a solution.
My best guess is something in your code is not well supported in the Clover compiler which is not part of this plugin. We use the OpenClover library and issues of that sort are typically rooted in some obscure Groovy problem that the OpenClover Groovy compilation cannot handle. One such issue that was resolved before was the use of CompileStatic annotations which triggered some unexpected failures and a user contributed a fix that allowed the additionalGroovyOpts feature you are making use of to exist. Perhaps this is a similar situation with the @Transactional annotation you need for your class.
Given how little code is in that class and the sparsity of conditional logic might you consider excluding that class from instrumentation and avoiding this issue as a workaround?
Thank you very much for your reply. We decided to move to using Jacoco in our project instead, so I can't really recreate this anymore. Thanks anyway :)
When I run the gradle :test task in my Grails project, some tests fail with
MissingMethodException
, but most tests pass. When I run my tests from IntelliJ (using the same gradle version), none of my tests fail. Disabling clover and running the :test task also makes all my tests pass. I believe there is something in Clover that generates thereMissingMethodException
.More specifically, it seems like Clover can't handle my
ServiceUnitTest
s where I'm fetching configs from theHolders
class. This is the error message:The
AdminService
class is defined below:And my clover gradle config:
Expected Behavior
If running tests without Clover does not fail, I would expect them to pass when Clover is enabled.
Current Behavior
See above explanation of
MissingMethodException
. The weird thing is, I have other Grails projects with multiple sub-projects, where this is not an issue. I'm using the same gradle and clover versions and the same gradle setup of clover, but it stil fails.Context
I'm trying to use Clover to measure line coverage, but it results in some of my tests failing.
Steps to Reproduce (for bugs)
Run tests with
.\gradlew.bat test
Your Environment