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

Syntax

gradle farmIntegrationTest

Effects

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.

Example

// 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/akhikhl/gretty/tree/master/examples/farm