2.12 > Multi module project with multiple integration tests

not-a-bug

(Albert van Veen) #1
 (:dummy-plugin:integrationTest
 (
 (building.DummyIntegrationSpec > initializationError FAILED
 (    java.lang.ArrayStoreException
 (
 (1 test completed, 1 failed
 (:dummy-plugin:integrationTest FAILED
 (:dummy-plugin:mergeTestReports

Stacktrace failing test
<testcase name="initializationError" classname="DummyIntegrationSpec" time="0.0">
    <failure message="java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy" `type="java.lang.ArrayStoreException">java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
	at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724)
	at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)
	at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
	at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
	at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
	at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
	at java.lang.Class.createAnnotationData(Class.java:3521)
	at java.lang.Class.annotationData(Class.java:3510)
	at java.lang.Class.getAnnotations(Class.java:3446)
	at org.junit.runner.Description.createSuiteDescription(Description.java:124)
	at org.junit.internal.runners.ErrorReportingRunner.getDescription(ErrorReportingRunner.java:28)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.allTestsFiltered(JUnitTestClassExecuter.java:117)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:106)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:56)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
	at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Gradle Version: 2.13 also occurs on 2.12
Operating System: Windows but also occurs on Mac
Is this a regression? If yes, which version of Gradle do you know it last worked for? No working version found

Reproduced the issue by setting

When running a multi module project with both an integration test, the test will fail with the above stacktrace. When there is only one integration test, the build will pass. Both modules are grails plugins in the setup.


(Stefan Wolf) #2

Hi Albert,

thanks for reporting. It would be great if you could provide an example build file and test class where this happens.

Looking at your stack trace I can only assume that there are some annotations on the test class or method which cannot be loaded at runtime. This would hint to some dependencies missing on the configuration for the integration test.

Best regards,
Stefan


(Albert van Veen) #3

Hi Stefan,

Thanks for your response. I’ve created a github repo where i reproduced the bug.

If you run gradle clean build in the grails-dummy-plugin folder you will get the failing tests.

Regards,

Albert


(Stefan Wolf) #4

Hi Albert,

thanks for the example. It looks like there is some annotation in the test classes which is not provided by a dependency. Since you are having many dependencies and plugins apply it is not easy for me to spot the missing annotation.

Regards,
Stefan


(Albert van Veen) #5

Hi Stefan,

found the cause by debugging Gradle. I’ve should had a closer look at the documentation. The @Integration annotation of the grails plugin tells the following:

public @interface Integration {

    /**
     *
     * Specify the Application class which should be used for
     * this functional test.  If unspecified the test runtime
     * environment will attempt to locate a class in the project
     * which extends grails.boot.config.GrailsAutoConfiguration
     * which can be problematic in multi project builds where
     * multiple Application classes may exist.
     */
    Class applicationClass() default {}
}

So i’ve added the right Application class which resolved the issue. Thanks for your help!

Regards,

Albert


(Stefan Wolf) #6

Hi Albert,

thanks for following up on this and posting your solution! I am glad you were able to fix your problem.

Cheers,
Stefan