Quantcast

grails-core tests fail when run with gradlew test

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

grails-core tests fail when run with gradlew test

dmurat
This post has NOT been accepted by the mailing list yet.
Hi

I'm having trouble with running grails-core tests. After cloning repo, and executing "gradlew install", "gradlew test" consistently fails on "org.codehaus.groovy.grails.web.binding.JSONBindingToNullTests.testXmlBindingToNull()". It reports "org.xml.sax.SAXParserException: Premature end of file". I can provide full stacktrace if necessary.

Is this known issue, or is there some option needed to be set for tests to succeed? I mean, maybe I'm doing something wrong since the test does succeed on official hudson server.

Same test fails on both Ubuntu and Windows 7 while using sun jdk 1.6.0_26.

Best regards,
Damir Murat
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: grails-core tests fail when run with gradlew test

dmurat
This post has NOT been accepted by the mailing list yet.
I believe I've found a workaround for this issue.

First, it should be noted that I was able to successfully run the test from an IDE (IDEA). With this in mind, and after looking at "grails-core/grails-test-suite-web/build.gradle", I tried to isolate a test as it is already done for some others in "build.gradle".

After that, test succeeded, but another one failed on Ubuntu (org.codehaus.groovy.grails.web.converters.ControllerWithXmlConvertersTests.testConvertArrayWithNullElements()), but not on Windows 7. Without looking at details, I added that test in isolation too. And it worked :-)

Bellow is a modified version of "grails-core/grails-test-suite-web/build.gradle":
--------------------------
dependencies {

    testRuntime 'javax.servlet.jsp:jsp-api:2.1'
    testRuntime 'jstl:jstl:1.1.2'
    testRuntime 'javax.el:el-api:1.0'

    testCompile "commons-io:commons-io:${commonsIOVersion}"
    testCompile project(':grails-test-suite-base'),
                project(':grails-plugin-testing'),
                project(':grails-plugin-domain-class'),
                project(':grails-plugin-codecs'),
                project(':grails-plugin-datasource'),
                project(':grails-plugin-i18n'),
                project(':grails-plugin-servlets'),
                project(':grails-plugin-logging'),
                project(':grails-plugin-url-mappings'),
                project(':grails-plugin-services'),
                project(':grails-hibernate'),
                project(':grails-webflow')
}
test {
    maxParallelForks = 4
    forkEvery = 100
    jvmArgs = ['-Xmx1024M','-XX:MaxPermSize=192m']
    excludes = ["**/*TestCase.class",
                "**/*\$*.class",
                "**/ContentFormatControllerTests.class",
                "**/JSONBindingTests.class",
                "**/AutoParams*MarshallingTests.class",
                "**/JSONBindingToNullTests.class",
                "**/ControllerWithXmlConvertersTests.class"]
}

task isolatedTestsOne(type:Test) {
    includes = [
                "**/ContentFormatControllerTests.class"
                ]
}
task isolatedTestsTwo(type:Test) {
    includes = [
                "**/JSONBindingTests.class",
                "**/AutoParams*MarshallingTests.class"]
}
task isolatedTestsThree(type:Test) {
    includes = [
                "**/JSONBindingToNullTests.class",
                "**/ControllerWithXmlConvertersTests.class"
                ]
}


test.dependsOn isolatedTestsOne, isolatedTestsTwo, isolatedTestsThree
--------------------------

Please note that now all grails-core tests pass on Ubuntu, but some still fail on Windows 7. However, this is another issue.

Best regards,
Damir Murat
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: grails-core tests fail when run with gradlew test

dmurat
This post has NOT been accepted by the mailing list yet.
Just curious... anybody else has this issue, or it is just me?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: grails-core tests fail when run with gradlew test

dmurat
This post has NOT been accepted by the mailing list yet.
Loading...