|
Hi,
I would like to create some integration tests that run against an an IPBX (see it as an external application). This adds a lot of constraints : you have to be on site for running the tests, the IPBX has to be started and the tests take forever to run. So I would like to create them as a separate test suite, so that when I launch grails test-app -integration there are not ran. I would like the exact same testing infrastructure than usual integration tests (database and Spring launched...) but to store tests in a separate folder and have them run with a special option or a separate command. I do not see really well how to do this so that it integrates nicely with Grails. Reading the documentation, it looks like I could do something like grails test-app integration:myTestType, but I do not see how I can create my own test type. Do you have any idea how I could do this ? Thanks. Antoine --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
On 30/04/2010, at 2:50 AM, Antoine Roux wrote: > Hi, > I would like to create some integration tests that run against an an IPBX (see it as an external application). This adds a lot of constraints : you have to be on site for running the tests, the IPBX has to be started and the tests take forever to run. So I would like to create them as a separate test suite, so that when I launch grails test-app -integration there are not ran. > I would like the exact same testing infrastructure than usual integration tests (database and Spring launched...) but to store tests in a separate folder and have them run with a special option or a separate command. > > I do not see really well how to do this so that it integrates nicely with Grails. Reading the documentation, it looks like I could do something like grails test-app integration:myTestType, but I do not see how I can create my own test type. > > Do you have any idea how I could do this ? Thanks. I would do it this way… Create test/ipbx and store your test files in there. add this to scripts/_Events.groovy eventAllTestsStart = { if (testOptions.ipbxOnly) { phasesToRun = ["integration"] // remove the other phases integrationTests = [] // remove the normal integration tests addIpbxTestType() } else if (testOptions.withIpbx) { addIpbxTestType() } } addIpbxTestType = { integrationTests << "ipbx" // A string test type gets treated as the Grails default JUnit type. } So you would run… grails test-app -ipbx-only To run just the ipbx tests, or… grails test-app -with-ipbx To run all tests. Give that a try and let me know. I haven't tested it but it should work. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
Luke, is this kind of thing documented anywhere or was this gleaned from
the source itself? My group would love to have custom test types that go out to a remote Jboss server and execute RMI calls, etc. This is just the kind of thing we were looking for. Thanks! -- Chris -----Original Message----- From: Luke Daley [mailto:[hidden email]] Sent: Monday, May 17, 2010 7:01 PM To: [hidden email] Subject: Re: [grails-user] Running some tests in a separate test suite On 30/04/2010, at 2:50 AM, Antoine Roux wrote: > Hi, > I would like to create some integration tests that run against an an IPBX (see it as an external application). This adds a lot of constraints : you have to be on site for running the tests, the IPBX has to be started and the tests take forever to run. So I would like to create them as a separate test suite, so that when I launch grails test-app -integration there are not ran. > I would like the exact same testing infrastructure than usual integration tests (database and Spring launched...) but to store tests in a separate folder and have them run with a special option or a separate command. > > I do not see really well how to do this so that it integrates nicely with Grails. Reading the documentation, it looks like I could do something like grails test-app integration:myTestType, but I do not see how I can create my own test type. > > Do you have any idea how I could do this ? Thanks. I would do it this way... Create test/ipbx and store your test files in there. add this to scripts/_Events.groovy eventAllTestsStart = { if (testOptions.ipbxOnly) { phasesToRun = ["integration"] // remove the other phases integrationTests = [] // remove the normal integration tests addIpbxTestType() } else if (testOptions.withIpbx) { addIpbxTestType() } } addIpbxTestType = { integrationTests << "ipbx" // A string test type gets treated as the Grails default JUnit type. } So you would run... grails test-app -ipbx-only To run just the ipbx tests, or... grails test-app -with-ipbx To run all tests. Give that a try and let me know. I haven't tested it but it should work. --------------------------------------------------------------------- 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 |
|
It's not documented anywhere. I had the same requirement a while ago so gleaned it from the source code.
Point taken though: http://jira.codehaus.org/browse/GRAILS-6301 On 19/05/2010, at 6:48 AM, <[hidden email]> <[hidden email]> wrote: > Luke, is this kind of thing documented anywhere or was this gleaned from > the source itself? > > My group would love to have custom test types that go out to a remote > Jboss server and execute RMI calls, etc. > > This is just the kind of thing we were looking for. > > Thanks! > > -- Chris > > -----Original Message----- > From: Luke Daley [mailto:[hidden email]] > Sent: Monday, May 17, 2010 7:01 PM > To: [hidden email] > Subject: Re: [grails-user] Running some tests in a separate test suite > > > On 30/04/2010, at 2:50 AM, Antoine Roux wrote: > >> Hi, >> I would like to create some integration tests that run against an an > IPBX (see it as an external application). This adds a lot of constraints > : you have to be on site for running the tests, the IPBX has to be > started and the tests take forever to run. So I would like to create > them as a separate test suite, so that when I launch grails test-app > -integration there are not ran. >> I would like the exact same testing infrastructure than usual > integration tests (database and Spring launched...) but to store tests > in a separate folder and have them run with a special option or a > separate command. >> >> I do not see really well how to do this so that it integrates nicely > with Grails. Reading the documentation, it looks like I could do > something like grails test-app integration:myTestType, but I do not see > how I can create my own test type. >> >> Do you have any idea how I could do this ? Thanks. > > I would do it this way... > > Create test/ipbx and store your test files in there. > > add this to scripts/_Events.groovy > > eventAllTestsStart = { > if (testOptions.ipbxOnly) { > phasesToRun = ["integration"] // remove the other phases > integrationTests = [] // remove the normal integration > tests > addIpbxTestType() > } else if (testOptions.withIpbx) { > addIpbxTestType() > } > } > > addIpbxTestType = { > integrationTests << "ipbx" // A string test type gets treated as > the Grails default JUnit type. > } > > So you would run... > > grails test-app -ipbx-only > > To run just the ipbx tests, or... > > grails test-app -with-ipbx > > To run all tests. > > Give that a try and let me know. I haven't tested it but it should work. > --------------------------------------------------------------------- > 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 > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
In reply to this post by Stokes_Chris
Chris,
Just wrote this up as a blog entry with a bit more depth. I have been meaning to do this for a while. http://ldaley.com/post/615966534/custom-grails-test On 19/05/2010, at 6:48 AM, <[hidden email]> <[hidden email]> wrote: > Luke, is this kind of thing documented anywhere or was this gleaned from > the source itself? > > My group would love to have custom test types that go out to a remote > Jboss server and execute RMI calls, etc. > > This is just the kind of thing we were looking for. > > Thanks! > > -- Chris > > -----Original Message----- > From: Luke Daley [mailto:[hidden email]] > Sent: Monday, May 17, 2010 7:01 PM > To: [hidden email] > Subject: Re: [grails-user] Running some tests in a separate test suite > > > On 30/04/2010, at 2:50 AM, Antoine Roux wrote: > >> Hi, >> I would like to create some integration tests that run against an an > IPBX (see it as an external application). This adds a lot of constraints > : you have to be on site for running the tests, the IPBX has to be > started and the tests take forever to run. So I would like to create > them as a separate test suite, so that when I launch grails test-app > -integration there are not ran. >> I would like the exact same testing infrastructure than usual > integration tests (database and Spring launched...) but to store tests > in a separate folder and have them run with a special option or a > separate command. >> >> I do not see really well how to do this so that it integrates nicely > with Grails. Reading the documentation, it looks like I could do > something like grails test-app integration:myTestType, but I do not see > how I can create my own test type. >> >> Do you have any idea how I could do this ? Thanks. > > I would do it this way... > > Create test/ipbx and store your test files in there. > > add this to scripts/_Events.groovy > > eventAllTestsStart = { > if (testOptions.ipbxOnly) { > phasesToRun = ["integration"] // remove the other phases > integrationTests = [] // remove the normal integration > tests > addIpbxTestType() > } else if (testOptions.withIpbx) { > addIpbxTestType() > } > } > > addIpbxTestType = { > integrationTests << "ipbx" // A string test type gets treated as > the Grails default JUnit type. > } > > So you would run... > > grails test-app -ipbx-only > > To run just the ipbx tests, or... > > grails test-app -with-ipbx > > To run all tests. > > Give that a try and let me know. I haven't tested it but it should work. > --------------------------------------------------------------------- > 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 > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
| Powered by Nabble | Edit this page |
