gradle-dockerized-test-plugin icon indicating copy to clipboard operation
gradle-dockerized-test-plugin copied to clipboard

Does not work in gradle multi project

Open iNikem opened this issue 10 years ago • 2 comments

I have a gradle multi project and trying to run test target from one of the subprojects using this plugin. My tests fail because they don't see classes from dependent subproject. This dependency is expressed by compile project(':agent')

eu.plumbr.portal.web.ping.PingControllerTest > Ping FAILED
    java.lang.NoClassDefFoundError: eu/plumbr/agent/http/PingAction
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
        at java.lang.Class.getDeclaredConstructors(Class.java:1906)
        at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
        at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
        at eu.plumbr.portal.web.ping.PingControllerTest.Ping(PingControllerTest.groovy:15)

        Caused by:
        java.lang.ClassNotFoundException: eu.plumbr.agent.http.PingAction
            at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
            ... 5 more

iNikem avatar Feb 11 '15 12:02 iNikem

I have solved this issue by adding volumes << ["$rootDir":rootDir]. I believe you should by default add mapping for rootDir, not for project dir

iNikem avatar Feb 11 '15 13:02 iNikem

Good catch, would you like to submit the patch?

pedjak avatar Mar 30 '15 19:03 pedjak