Discussion:
Integration test lifecycle
Rob Fletcher
2012-06-07 21:01:29 UTC
Permalink
Hi

I'm trying to write some integration tests that require an application to be running for execution & wondering what the best way is to manage this in gradle.

I have defined an `integrationTest` task of type _Test_ and tried the following methods to start and stop the application:

- using `doFirst` and `doLast`
- using `beforeSuite` and `afterSuite`
- using Ant style dependency chaining

With all these the problem I find is that the application is not stopped if the tests fail & is still running after gradle exits. Is there a 'correct' way to handle this scenario?
--
Rob Fletcher
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
Rob Fletcher
2012-06-07 21:21:26 UTC
Permalink
Failed to notify test listener.
Cannot start long running operation, as the task artifact state cache (/Users/rob/Workspace/gr8conf.2012/gradle-vertx/.gradle/1.0-rc-3/taskArtifacts) has not been locked.
I guess this is because the task used to stop my application does so in a separate thread.
--
Rob Fletcher
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
Hi
I'm trying to write some integration tests that require an application to be running for execution & wondering what the best way is to manage this in gradle.
- using `doFirst` and `doLast`
- using `beforeSuite` and `afterSuite`
- using Ant style dependency chaining
With all these the problem I find is that the application is not stopped if the tests fail & is still running after gradle exits. Is there a 'correct' way to handle this scenario?
--
Rob Fletcher
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
Luke Daley
2012-06-11 17:18:52 UTC
Permalink
Is this still an issue Rob, or did you find a solution?
Post by Rob Fletcher
Failed to notify test listener.
Cannot start long running operation, as the task artifact state cache (/Users/rob/Workspace/gr8conf.2012/gradle-vertx/.gradle/1.0-rc-3/taskArtifacts) has not been locked.
I guess this is because the task used to stop my application does so in a separate thread.
--
Rob Fletcher
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
Hi
I'm trying to write some integration tests that require an application to be running for execution & wondering what the best way is to manage this in gradle.
- using `doFirst` and `doLast`
- using `beforeSuite` and `afterSuite`
- using Ant style dependency chaining
With all these the problem I find is that the application is not stopped if the tests fail & is still running after gradle exits. Is there a 'correct' way to handle this scenario?
--
Rob Fletcher
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com
Rob Fletcher
2012-06-13 20:46:11 UTC
Permalink
I managed to get it working by using a TaskExecutionListener: https://github.com/robfletcher/gradle-vertx/blob/master/examples/groovy/build.gradle#L45
--
Rob Fletcher
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
Post by Luke Daley
Is this still an issue Rob, or did you find a solution?
Post by Rob Fletcher
Failed to notify test listener.
Cannot start long running operation, as the task artifact state cache (/Users/rob/Workspace/gr8conf.2012/gradle-vertx/.gradle/1.0-rc-3/taskArtifacts) has not been locked.
I guess this is because the task used to stop my application does so in a separate thread.
--
Rob Fletcher
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
Hi
I'm trying to write some integration tests that require an application to be running for execution & wondering what the best way is to manage this in gradle.
- using `doFirst` and `doLast`
- using `beforeSuite` and `afterSuite`
- using Ant style dependency chaining
With all these the problem I find is that the application is not stopped if the tests fail & is still running after gradle exits. Is there a 'correct' way to handle this scenario?
--
Rob Fletcher
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
Loading...