farmIntegrationTest runs integration tests on the default farm. To run integration tests on the named farm, use farmIntegrationTestXYZ, where XYZ is the farm name.


gradle farmIntegrationTest


farmIntegrationTest performs the following sequence:

  1. perform farmBeforeIntegrationTest task, thus starting web-server.

  2. iteratively perform integrationTest task on each web-app of the farm.

  3. 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:


The full and working example program is found here: