gradle farmIntegrationTest
farmIntegrationTest runs integration tests on the default farm. To run integration tests on the named farm, use farmIntegrationTestXYZ, where XYZ is the farm name.
farmIntegrationTest performs the following sequence:
perform farmBeforeIntegrationTest task, thus starting web-server.
iteratively perform integrationTest task on each web-app of the farm.
perform farmAfterIntegrationTest task, thus stopping web-server.
// RootProject/build.gradle
farm {
webapp ':ProjectA'
webapp ':ProjectB'
integrationTestTask = 'myIntegrationTest'
}
configure(project(':ProjectA'), project(':ProjectB')) {
test {
include '**/Test*.*'
include '**/*Test.*'
exclude '**/*IT.*'
}
task myIntegrationTest(type: Test, dependsOn: 'test') {
outputs.upToDateWhen { false }
include '**/*IT.*'
}
}
when invoking:
gradle farmIntegrationTest
the resulting task invokation sequence is:
:RootProject:farmBeforeIntegrationTest
:ProjectA:myIntegrationTest
:ProjectB:myIntegrationTest
:RootProject:farmAfterIntegrationTest
The full and working example program is found here: https://github.com/gretty-gradle-plugin/gretty/tree/master/integrationTests/farm