Unit tests fail to run after upgrade from grails 2.3 to 2.5

1k views Asked by At

Upgrading a fairly large app from Grails 2.3.11 to Grails 2.5.0, and I have things mostly working. Integration tests run, and run-app that loads a ton of fixture data works well, and the app seems to work well in exploratory testing, but unit tests just won't run at all.

The error and stacktrace isn't very helpful to me and doesn't turn up much for results on Google, so I am wondering if anyone has any ideas on what is happening.

When I run grails test-app unit: the error throws almost right away:

Error running unit tests: org.spockframework.extension.ReportExtension.start()
...
| Error Exception in thread "org.spockframework.runtime.RunContext.stop()" 
| Error java.lang.AbstractMethodError: org.spockframework.extension.ReportExtension.stop()V
| Error     at org.spockframework.runtime.GlobalExtensionRegistry.stopGlobalExtensions(GlobalExtensionRegistry.java:111)
| Error     at org.spockframework.runtime.RunContext.stop(RunContext.java:67)
| Error     at org.spockframework.runtime.RunContext.access$000(RunContext.java:30)
| Error     at org.spockframework.runtime.RunContext$2.run(RunContext.java:159)

I have tried removing all the unit tests and replacing one at a time, but no luck there. Also I have done lots of cleaning up with grails clean and deleting the .grails dir and those types of things to try to make sure I am not using some old spock plugin as at one point the app did use that, but again, no luck. Even running with only one freshly generated unit test from a freshly installed scaffolding template has the same problem. If there are no unit tests it does not complain.

Interestingly A freshly created app doesn't seem to work perfectly either, but I can not tell if the problems are related.In that app with just 3 domains and tests all generated using grails generate-domain-class the output looks like this:

| Running 3 unit tests... 1 of 3
| Failure:  initializationError(org.junit.runner.manipulation.Filter)
|  java.lang.Exception: No tests found matching grails test target pattern filter from org.junit.runner.Request$1@5ea22f37
at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:40)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
| Completed 1 unit test, 1 failed in 0m 0s

Since it seems slightly possible the problem might be somehow related to my system and my Grails install I will add that I am running Ubuntu, with Grails installed via GVM

1

There are 1 answers

0
aeischeid On

Problem with my main application was an old Spock jar in the lib folder. What that was doing there... I don't even know. Didn't occur to me to look there before.

Still doesn't explain the odd output from the freshly created app so feel free to chime in on that!