Quantcast

Geb/Grails tests only work on first execution

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

Geb/Grails tests only work on first execution

Tim R
Hey,

I'm trying to use Geb, Spock and Grails to do functional tests but i'm running into issues where the tests will only pass a second time if I clear out the grails.project.work.dir folder manually.

I've almost copied the geb-example-grails app identically.  Apart from my test.  I'm using HtmlUnitDriver.

I've run out of ideas, so any help is much appreciated.

My test looks like this:

package uk.co.tribal.cps

import spock.lang.*
import pages.*
import geb.spock.GebReportingSpec
import geb.*

class ContentControllerGebSpec extends GebReportingSpec {

    def "Google"() {

        when:
            go 'http://www.google.co.uk/'

        then:
            title =~ 'Google'
    }
}


And the error I get when I try to run this a second time is this:

failed to create driver from callback 'script1311001577623675671241$_run_closure1@4916b'
geb.driver.DriverCreationException: failed to create driver from callback 'script1311001577623675671241$_run_closure1@4916b'
        at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
        at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:36)
        at geb.Configuration.createDriver(Configuration.groovy:210)
        at geb.Configuration.getDriver(Configuration.groovy:199)
        at geb.Browser.getDriver(Browser.groovy:100)
        at geb.Browser.go(Browser.groovy:300)
        at geb.Browser.go(Browser.groovy:292)
        at geb.spock.GebSpec.methodMissing(GebSpec.groovy:51)
        at uk.co.tribal.cps.ContentControllerGebSpec.Google(ContentControllerGebSpec.groovy:13)
Caused by: org.openqa.selenium.WebDriverException: com.gargoylesoftware.htmlunit.ObjectInstantiationException: unable to create HTML parser
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_25'
Driver info: driver.version: HtmlUnitDriver
        at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:323)
        at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:293)
        at org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:132)
        at org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:142)
        at org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:138)
        at script1311001577623675671241.run_closure1(script1311001577623675671241.groovy:14)
        at script1311001577623675671241.run_closure1(script1311001577623675671241.groovy)
        at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)
Caused by: com.gargoylesoftware.htmlunit.ObjectInstantiationException: unable to create HTML parser
        at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:189)
        at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:165)
        at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:225)
        at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:108)
        at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:429)
        at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307)
        at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:369)
        at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:317)

Cheers

Tim..
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

ld@ldaley.com
This is likely a Groovy XML dependencies problem, are you excluding xml-apis from the driver dependencies?

                test("org.seleniumhq.selenium:selenium-htmlunit-driver:$seleniumVersion") {
                        exclude "xml-apis"
                }


On 19/07/2011, at 1:09 AM, Tim R wrote:

> Hey,
>
> I'm trying to use Geb, Spock and Grails to do functional tests but i'm
> running into issues where the tests will only pass a second time if I clear
> out the grails.project.work.dir folder manually.
>
> I've almost copied the geb-example-grails app identically.  Apart from my
> test.  I'm using HtmlUnitDriver.
>
> I've run out of ideas, so any help is much appreciated.
>
> My test looks like this:
>
> package uk.co.tribal.cps
>
> import spock.lang.*
> import pages.*
> import geb.spock.GebReportingSpec
> import geb.*
>
> class ContentControllerGebSpec extends GebReportingSpec {
>
>    def "Google"() {
>
>        when:
>            go 'http://www.google.co.uk/'
>
>        then:
>            title =~ 'Google'
>    }
> }
>
>
> And the error I get when I try to run this a second time is this:
>
> failed to create driver from callback
> 'script1311001577623675671241$_run_closure1@4916b'
> geb.driver.DriverCreationException: failed to create driver from callback
> 'script1311001577623675671241$_run_closure1@4916b'
> at
> geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
> at
> geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:36)
> at geb.Configuration.createDriver(Configuration.groovy:210)
> at geb.Configuration.getDriver(Configuration.groovy:199)
> at geb.Browser.getDriver(Browser.groovy:100)
> at geb.Browser.go(Browser.groovy:300)
> at geb.Browser.go(Browser.groovy:292)
> at geb.spock.GebSpec.methodMissing(GebSpec.groovy:51)
> at
> uk.co.tribal.cps.ContentControllerGebSpec.Google(ContentControllerGebSpec.groovy:13)
> Caused by: org.openqa.selenium.WebDriverException:
> com.gargoylesoftware.htmlunit.ObjectInstantiationException: unable to create
> HTML parser
> Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
> System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1',
> java.version: '1.6.0_25'
> Driver info: driver.version: HtmlUnitDriver
> at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:323)
> at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:293)
> at
> org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:132)
> at
> org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:142)
> at
> org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:138)
> at
> script1311001577623675671241.run_closure1(script1311001577623675671241.groovy:14)
> at
> script1311001577623675671241.run_closure1(script1311001577623675671241.groovy)
> at
> geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)
> Caused by: com.gargoylesoftware.htmlunit.ObjectInstantiationException:
> unable to create HTML parser
> at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:189)
> at
> com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:165)
> at
> com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:225)
> at
> com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:108)
> at
> com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:429)
> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307)
> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:369)
> at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:317)
>
> Cheers
>
> Tim..
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Geb-Grails-tests-only-work-on-first-execution-tp3675543p3675543.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

Tim R
Hey Luke,

I think I've found the issue.  The only two differences I have to your https://github.com/geb/geb-example-grails is 1) I upgraded it to grail 1.3.7 and 2) I added a dependency on the release plugin in the buildConfig.groovy.  When I comment out the release plugin dependency I can run the tests over and over with out failure.  Else it always fails on the second execution.

Any ideas why the release plugin should cause this issue?  


--- a/grails-app/conf/BuildConfig.groovy
+++ b/grails-app/conf/BuildConfig.groovy
@@ -34,5 +34,10 @@ grails.project.dependency.resolution = {

                test ":geb:$gebVersion"
                test ":spock:0.5-groovy-1.7"
+        build(':release:latest.integration') {
+            excludes "svn" // excludes most recent version
+        }
        }
 }
\ No newline at end of file


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

ld@ldaley.com
The release plugin will add a newer version of a HTMLUnit dependency that is incompatible with HTMLUnit. The inverse might not be true though, so you could find what are the common dependencies between the two and exclude those from the release plugin.

On 19/07/2011, at 8:39 PM, Tim R <[hidden email]> wrote:

> Hey Luke,
>
> I think I've found the issue.  The only two differences I have to your
> https://github.com/geb/geb-example-grails is 1) I upgraded it to grail 1.3.7
> and 2) I added a dependency on the release plugin in the buildConfig.groovy.
> When I comment out the release plugin dependency I can run the tests over
> and over with out failure.  Else it always fails on the second execution.
>
> Any ideas why the release plugin should cause this issue?  
>
>
> --- a/grails-app/conf/BuildConfig.groovy
> +++ b/grails-app/conf/BuildConfig.groovy
> @@ -34,5 +34,10 @@ grails.project.dependency.resolution = {
>
>                test ":geb:$gebVersion"
>                test ":spock:0.5-groovy-1.7"
> +        build(':release:latest.integration') {
> +            excludes "svn" // excludes most recent version
> +        }
>        }
> }
> \ No newline at end of file
>
>
>
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Geb-Grails-tests-only-work-on-first-execution-tp3675543p3677822.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

Tim R
I'm a little confused by this.  The release plugin in uses the build configuration.  So how/why does it affect the test configuration?

I've been studying the dependency report generated by grails and I can't see any reference to htmlunit in the build phase.  Oh on the other hand both configurations use different version of nekohtml, but excluding that didn't seem to make a difference either.

Is there an easy way to list dependencies by plugin?  Can you recommend how one attempts to debug/resolve this?


Cheers for you help

Tim..

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

ld@ldaley.com
On 19/07/2011, at 10:00 PM, Tim R <[hidden email]> wrote:

> I'm a little confused by this.  The release plugin in uses the build
> configuration.  So how/why does it affect the test configuration?

I can't remember the precise details, but for practical reasons the classloaders are not completely isolated. In essence, the runtime extends from the build environment.

>
> I've been studying the dependency report generated by grails and I can't see
> any reference to htmlunit in the build phase.  Oh on the other hand both
> configurations use different version of nekohtml, but excluding that didn't
> seem to make a difference either.

This will be the problem. The nekohtml of the release plugin is leaking through to test and is incompatible with HTMLUnit.

> Is there an easy way to list dependencies by plugin?  

Not that I know of.

> Can you recommend how
> one attempts to debug/resolve this?

Manually exclude nekohtml from the release plugin and add a build scoped dependency on nekohtml for the same version that is used by HTMLUnit… then pray that that version is compatible with the release plugin.

Another thing to consider is using a real driver instead of HTMLUnit.
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

Tim R
Nailed it!!

Thanks for your help Luke


Snippet from BuildConf.groovy

dependencies {
               
     // same as example

     build('net.sourceforge.nekohtml:nekohtml:1.9.14') {
          excludes "xml-apis"
     }
}
plugins {

     // same as example

     build(':release:1.0.0.M3') {
         excludes "svn", 'nekohtml'
     }
}
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

ld@ldaley.com
Great to know, hopefully future users with the same problem find this thread.

On 20/07/2011, at 12:41 AM, Tim R wrote:

> Nailed it!!
>
> Thanks for your help Luke
>
>
> Snippet from BuildConf.groovy
>
> dependencies {
>
>     // same as example
>
>     build('net.sourceforge.nekohtml:nekohtml:1.9.14') {
>          excludes "xml-apis"
>     }
> }
> plugins {
>
>     // same as example
>
>     build(':release:1.0.0.M3') {
>         excludes "svn", 'nekohtml'
>     }
> }
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Geb-Grails-tests-only-work-on-first-execution-tp3675543p3678280.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

Dean Del Ponte-2
I think I'm running into a similar problem.

After installing the ajax-uploader pllugin, I'm unable to run geb tests.  I think it's because the ajax-uploader plugin depends on the release plugin.

How can I edit BuildConfig dependencies so the the plugin of a plugin doesn't cause problems during test?

Here's the errors:

failed to create driver from callback 'script1320458633508668426329$_run_closure2_closure3_closure5@2d410709'
geb.driver.DriverCreationException: failed to create driver from callback 'script1320458633508668426329$_run_closure2_closure3_closure5@2d410709'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:36)
at geb.Configuration.createDriver(Configuration.groovy:218)
at geb.Configuration.getDriver(Configuration.groovy:207)
at geb.Browser.getDriver(Browser.groovy:100)
at geb.report.PageSourceReporter.getPageSource(PageSourceReporter.groovy:39)
at geb.report.PageSourceReporter.writePageSource(PageSourceReporter.groovy:35)
at geb.report.PageSourceReporter.writeReport(PageSourceReporter.groovy:27)
at geb.report.ScreenshotAndPageSourceReporter.writeReport(ScreenshotAndPageSourceReporter.groovy:31)
at geb.Browser.report(Browser.groovy:489)
at geb.spock.GebReportingSpec.report(GebReportingSpec.groovy:43)
at geb.spock.GebReportingSpec.cleanup(GebReportingSpec.groovy:39)
Caused by: java.lang.IllegalStateException: The path to the chromedriver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://code.google.com/p/chromium/downloads/list
at com.google.common.base.Preconditions.checkState(Preconditions.java:172)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:85)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:87)
at script1320458633508668426329.run_closure2_closure3_closure5(script1320458633508668426329.groovy:24)
at script1320458633508668426329.run_closure2_closure3_closure5(script1320458633508668426329.groovy)
at groovy.lang.Closure.call(Closure.java:282)
at groovy.lang.Closure.call(Closure.java:277)
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)
... 11 more

Thanks!

Dean Del Ponte

On Tue, Jul 19, 2011 at 6:54 PM, Luke Daley <[hidden email]> wrote:
Great to know, hopefully future users with the same problem find this thread.

On 20/07/2011, at 12:41 AM, Tim R wrote:

> Nailed it!!
>
> Thanks for your help Luke
>
>
> Snippet from BuildConf.groovy
>
> dependencies {
>
>     // same as example
>
>     build('net.sourceforge.nekohtml:nekohtml:1.9.14') {
>          excludes "xml-apis"
>     }
> }
> plugins {
>
>     // same as example
>
>     build(':release:1.0.0.M3') {
>         excludes "svn", 'nekohtml'
>     }
> }
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Geb-Grails-tests-only-work-on-first-execution-tp3675543p3678280.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

dstarr
In reply to this post by ld@ldaley.com
I'm getting this same issue now.  My tests only get run if i clean out my .grails dir. Please help! I have wasted so many hours on this dependency stuff I want to kill myself.   Here is my BuildConfig file:


grails.server.port.http = 9090
grails.server.port.https = 9443
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.war.osgi.headers=false
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.war.file = "target/ROOT.war"

// The dynamicJasper plugin has jars in its lib directory, one of which conflicts
grails.war.resources = {def stagingDir ->
        delete(file: "${stagingDir}/WEB-INF/lib/commons-collections-3.0.jar")
}

grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        // uncomment to disable ehcache
        // excludes 'ehcache'
        excludes "httpclient" // otherwise grails will download an old version which conflicts with Amazon's SQS library
    }

    log "debug" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
   
    repositories {
        grailsPlugins()
        grailsHome()
        grailsCentral()
        //mavenRepo "http://mt-avalanche.giiv.com:8081/artifactory/libs-release-local/"
        //mavenRepo "http://mt-avalanche.giiv.com:8081/artifactory/plugins-release-local/"

        // uncomment the below to enable remote dependency resolution
        // from public Maven repositories
        //mavenLocal()
        mavenCentral()
        //mavenRepo "http://snapshots.repository.codehaus.org"
        //mavenRepo "http://repository.codehaus.org"
        //mavenRepo "http://download.java.net/maven/2/"
        //mavenRepo "http://repository.jboss.com/maven2/"
    }
   
    plugins {
        test (':ckeditor:3.5.4.1') {
            excludes'release'
        }
        //build "org.grails.plugins:grails-grass:0.2"
    }
   
    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
        // runtime 'mysql:mysql-connector-java:5.1.5'
        //build 'org.springframework.context-3.0.5.RELEASE.jar' // for switchable datasources

        build 'org.apache.httpcomponents:httpclient:4.1.2' // for Amazon SQS
       
        test 'org.seleniumhq.selenium:selenium-firefox-driver:latest.release'
        test 'org.seleniumhq.selenium:selenium-chrome-driver:latest.release'
        test 'org.seleniumhq.selenium:selenium-ie-driver:latest.release'
                test 'org.seleniumhq.selenium:selenium-api:latest.release'
                test 'org.codehaus.geb:geb-spock:0.6.1'
     }

coverage {
    exclusions = ["**/*Nimble*", "**/nimble/**", "**/SeleniumConfig*", "**/ProfiledBuilder*",
        "<default>/*", "**/com/mattwilliamsnyc/**", "**/cybersource/**",
        "**/*gsp*"  // ignore gsps until other code coverage improves
    ]
}
}

Thanks
David
   
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

bksaville
I've tried for hours and hours to get this working with no success as of
yet.  Is there any chance we can resolve conflicts between these two
plugins as I believe a large number of projects will likely depend on
both.  As of now, I have geb installed but actually use the http-builder
to do a functional test since running actual geb tests does not work.

Thanks,
Brian

-----Original Message-----
From: dstarr [mailto:[hidden email]]
Sent: Sunday, November 13, 2011 6:20 PM
To: [hidden email]
Subject: [grails-user] Re: Geb/Grails tests only work on first execution

I'm getting this same issue now.  My tests only get run if i clean out my
.grails dir. Please help! I have wasted so many hours on this dependency
stuff I want to kill myself.   Here is my BuildConfig file:


grails.server.port.http = 9090
grails.server.port.https = 9443
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.war.osgi.headers=false
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.war.file = "target/ROOT.war"

// The dynamicJasper plugin has jars in its lib directory, one of which
conflicts grails.war.resources = {def stagingDir ->
        delete(file:
"${stagingDir}/WEB-INF/lib/commons-collections-3.0.jar")
}

grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        // uncomment to disable ehcache
        // excludes 'ehcache'
        excludes "httpclient" // otherwise grails will download an old
version which conflicts with Amazon's SQS library
    }

    log "debug" // log level of Ivy resolver, either 'error', 'warn',
'info', 'debug' or 'verbose'
   
    repositories {
        grailsPlugins()
        grailsHome()
        grailsCentral()
        //mavenRepo
"http://mt-avalanche.giiv.com:8081/artifactory/libs-release-local/"
        //mavenRepo
"http://mt-avalanche.giiv.com:8081/artifactory/plugins-release-local/"

        // uncomment the below to enable remote dependency resolution
        // from public Maven repositories
        //mavenLocal()
        mavenCentral()
        //mavenRepo "http://snapshots.repository.codehaus.org"
        //mavenRepo "http://repository.codehaus.org"
        //mavenRepo "http://download.java.net/maven/2/"
        //mavenRepo "http://repository.jboss.com/maven2/"
    }
   
    plugins {
        test (':ckeditor:3.5.4.1') {
            excludes'release'
        }
        //build "org.grails.plugins:grails-grass:0.2"
    }
   
    dependencies {
        // specify dependencies here under either 'build', 'compile',
'runtime', 'test' or 'provided' scopes eg.
        // runtime 'mysql:mysql-connector-java:5.1.5'
        //build 'org.springframework.context-3.0.5.RELEASE.jar' // for
switchable datasources

        build 'org.apache.httpcomponents:httpclient:4.1.2' // for Amazon
SQS
       
        test
'org.seleniumhq.selenium:selenium-firefox-driver:latest.release'
        test
'org.seleniumhq.selenium:selenium-chrome-driver:latest.release'
        test 'org.seleniumhq.selenium:selenium-ie-driver:latest.release'
                test 'org.seleniumhq.selenium:selenium-api:latest.release'
                test 'org.codehaus.geb:geb-spock:0.6.1'
     }

coverage {
    exclusions = ["**/*Nimble*", "**/nimble/**", "**/SeleniumConfig*",
"**/ProfiledBuilder*",
        "<default>/*", "**/com/mattwilliamsnyc/**", "**/cybersource/**",
        "**/*gsp*"  // ignore gsps until other code coverage improves
    ]
}
}

Thanks
David
   


--
View this message in context:
http://grails.1312388.n4.nabble.com/Geb-Grails-tests-only-work-on-first-ex
ecution-tp3675543p4038008.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

ld@ldaley.com
In reply to this post by dstarr
The original post was an issue with creating the HTMLUnit driver which you don't appear to be using.

Without details of the error you are getting it's impossible to help.

On 14/11/2011, at 1:19 AM, dstarr wrote:

> I'm getting this same issue now.  My tests only get run if i clean out my
> .grails dir. Please help! I have wasted so many hours on this dependency
> stuff I want to kill myself.   Here is my BuildConfig file:
>
>
> grails.server.port.http = 9090
> grails.server.port.https = 9443
> grails.project.class.dir = "target/classes"
> grails.project.test.class.dir = "target/test-classes"
> grails.project.test.reports.dir = "target/test-reports"
> grails.project.war.osgi.headers=false
> //grails.project.war.file = "target/${appName}-${appVersion}.war"
> grails.project.war.file = "target/ROOT.war"
>
> // The dynamicJasper plugin has jars in its lib directory, one of which
> conflicts
> grails.war.resources = {def stagingDir ->
> delete(file: "${stagingDir}/WEB-INF/lib/commons-collections-3.0.jar")
> }
>
> grails.project.dependency.resolution = {
>    // inherit Grails' default dependencies
>    inherits("global") {
>        // uncomment to disable ehcache
>        // excludes 'ehcache'
>        excludes "httpclient" // otherwise grails will download an old
> version which conflicts with Amazon's SQS library
>    }
>
>    log "debug" // log level of Ivy resolver, either 'error', 'warn',
> 'info', 'debug' or 'verbose'
>
>    repositories {
>        grailsPlugins()
>        grailsHome()
>        grailsCentral()
>        //mavenRepo
> "http://mt-avalanche.giiv.com:8081/artifactory/libs-release-local/"
>        //mavenRepo
> "http://mt-avalanche.giiv.com:8081/artifactory/plugins-release-local/"
>
>        // uncomment the below to enable remote dependency resolution
>        // from public Maven repositories
>        //mavenLocal()
>        mavenCentral()
>        //mavenRepo "http://snapshots.repository.codehaus.org"
>        //mavenRepo "http://repository.codehaus.org"
>        //mavenRepo "http://download.java.net/maven/2/"
>        //mavenRepo "http://repository.jboss.com/maven2/"
>    }
>
>    plugins {
>        test (':ckeditor:3.5.4.1') {
>            excludes'release'
>        }
>        //build "org.grails.plugins:grails-grass:0.2"
>    }
>
>    dependencies {
>        // specify dependencies here under either 'build', 'compile',
> 'runtime', 'test' or 'provided' scopes eg.
>        // runtime 'mysql:mysql-connector-java:5.1.5'
>        //build 'org.springframework.context-3.0.5.RELEASE.jar' // for
> switchable datasources
>
>        build 'org.apache.httpcomponents:httpclient:4.1.2' // for Amazon SQS
>
>        test
> 'org.seleniumhq.selenium:selenium-firefox-driver:latest.release'
>        test 'org.seleniumhq.selenium:selenium-chrome-driver:latest.release'
>        test 'org.seleniumhq.selenium:selenium-ie-driver:latest.release'
> test 'org.seleniumhq.selenium:selenium-api:latest.release'
> test 'org.codehaus.geb:geb-spock:0.6.1'
>     }
>
> coverage {
>    exclusions = ["**/*Nimble*", "**/nimble/**", "**/SeleniumConfig*",
> "**/ProfiledBuilder*",
> "<default>/*", "**/com/mattwilliamsnyc/**", "**/cybersource/**",
> "**/*gsp*"  // ignore gsps until other code coverage improves
>    ]
> }
> }
>
> Thanks
> David
>
>
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Geb-Grails-tests-only-work-on-first-execution-tp3675543p4038008.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

ld@ldaley.com
In reply to this post by bksaville

On 14/11/2011, at 1:47 AM, Brian Saville wrote:

> I've tried for hours and hours to get this working with no success as of
> yet.  Is there any chance we can resolve conflicts between these two
> plugins as I believe a large number of projects will likely depend on
> both.  As of now, I have geb installed but actually use the http-builder
> to do a functional test since running actual geb tests does not work.

You will have to ask the developer of http-builder to update the org.apache.httpcomponents dependencies used.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

dstarr
In reply to this post by ld@ldaley.com
You're right, i should have added more detail.  I am not getting any errors when running test-app functional:spock.  If i delete my .grails dir and then run that command, the tests pass.  However, when i run the same command a second time, the tests don't run at all.  I've set the logging to verbose and I can't find any exceptions.  I originally thought the release plugin was the culprit but if you view my BuildConfig file I've omitted that plugin for the test scope.  Let me know what additional details might be helpful in order to debug this issue.  I really want to use Geb/Spock for my tests, but I can't get them to run consistently.  I'm using the Firefox driver currently and it works perfectly during the first iteration.  Sorry for the lack of detail in my original reply.

Thanks,
David
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

Dean Del Ponte-2
Hi David,

I'm in the same boat.  I've posted a request to the groovy user mailing list inquiring into the possibility of updating http-builder to use more recent jars.

No response yet, but I'm hopeful!

Thanks,

Dean Del Ponte

On Mon, Nov 14, 2011 at 10:50 AM, dstarr <[hidden email]> wrote:
You're right, i should have added more detail.  I am not getting any errors
when running test-app functional:spock.  If i delete my .grails dir and then
run that command, the tests pass.  However, when i run the same command a
second time, the tests don't run at all.  I've set the logging to verbose
and I can't find any exceptions.  I originally thought the release plugin
was the culprit but if you view my BuildConfig file I've omitted that plugin
for the test scope.  Let me know what additional details might be helpful in
order to debug this issue.  I really want to use Geb/Spock for my tests, but
I can't get them to run consistently.  I'm using the Firefox driver
currently and it works perfectly during the first iteration.  Sorry for the
lack of detail in my original reply.

Thanks,
David

--
View this message in context: http://grails.1312388.n4.nabble.com/Geb-Grails-tests-only-work-on-first-execution-tp3675543p4040087.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

ld@ldaley.com
In reply to this post by dstarr

On 14/11/2011, at 4:50 PM, dstarr wrote:

> You're right, i should have added more detail.  I am not getting any errors
> when running test-app functional:spock.  If i delete my .grails dir and then
> run that command, the tests pass.  However, when i run the same command a
> second time, the tests don't run at all.  I've set the logging to verbose
> and I can't find any exceptions.  I originally thought the release plugin
> was the culprit but if you view my BuildConfig file I've omitted that plugin
> for the test scope.  

It's very likely that this is not doing the right thing and the release plugin and its dependencies are still on the classpath.

> Let me know what additional details might be helpful in
> order to debug this issue.

I'll need a sample application to poke around. I can't think of any other way.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

dstarr
Hey Luke,
Thanks for the reply.  I think I'm going to move our functional testing into a separate grails app anyhow.  So i shouldn't run into these dependency issues.  
Cheers,
David
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geb/Grails tests only work on first execution

bksaville
In reply to this post by Dean Del Ponte-2
Hey guys, I submitted this bug to http-builder JIRA asking for it.  I also
referenced your question on the groovy mailing list:

http://jira.codehaus.org/browse/GMOD-262

Perhaps it's a bit vain to make it a blocker, but it is truly blocking us
from using these two plugins together, which right now means absolutely no
functional testing since we must have the release plugin/http-builder.
Thanks,
Brian


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Loading...