I am setting up my build to run integration tests which I am running from Hudson and wondered what the best practices are for doing this (the question may be better suited to a Hudson forum - but thought I’d start here)
In our case, to run the integration tests we need our application deployed to Glassfish, so we have a Hudson job with the following 3 steps: 1. run a Gradle build (to compile, jar, war, ear and unit test) 2. deploy ear to Glassfish 3. run a Gradle build to execute integration tests.
I have followed the sample shipped with Gradle in samples\java\withIntegrationTests but this leaves me with a problem. As the Hudson job is performing the deployment, the step to run the integration tests is run in a separate VM so the integration test no longer has the dependencies and build artifacts from the first step. For now I have an ugly hack so the integration test references the build artifacts from the first step (i.e a hard-coded classpath). The only other choices I can think of are:
Run the integration tests on a separate Hudson job - and have this job check-out the code again, re-compile, then run integration tests (seems a bit wasteful)
Have the deploy step performed in the Gradle script? This would resolve my classpath issue, but is it possible to wait for a deployment to complete before my integration tests run?
Any advice appreciated - how are other people doing this?