Creates build configuration for separate integration tests. Provides configurable defaults for names and locations of output.
Build script snippet for use in all Gradle versions
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.spindrift:integration-test:1.2.0"
}
}
apply plugin: "com.spindrift.integration-test"
integrationTest
- Executes the integration tests
- The task name is integrationTest and is not modifiable
- Sets an integrationTestRuntime dependency on the testRuntime for convenience.
This is optional but defaults to true and can be overridden if not required.
Additional compile and runtime dependencies must be set in the build configuration as normal - Sets a dependency from the default check task on integrationTest (configurable below).
- Sets a dependency between the integrationTest task and its related compile task and the main source compile task.
- Forces the integrationTests to run after unit tests (configurable below)
- Note: As the sourceSet is named integrationTest, even though the source directories default to
src/integration-test/java
gradle will still look forsrc/integrationTest/java
as well.
Property | Default Value | Description |
---|---|---|
javaSourceDir | src/integration-test/java |
The sourceSet source path |
resourcesSourceDir | src/integration-test/resources |
The sourceSet resources path |
runtimeDependsOnTestRuntime | true |
Optionally sets the integrationTest runtime dependencies to include normal test runtime. |
checkDependsOnIntegrationTest | true |
Optionally sets the check task to depend on integrationsTest |
mustRunAfterTest | true |
Optionally sets integration tests to run after unit tests |
Note All configuration is applied post evaluation of the task graph generation.
integrationTest {
javaSourceDir 'src/intTest/java'
resourcesSourceDir 'src/intTest/resources'
runtimeDependsOnTestRuntime false
checkDependsOnIntegrationTest false
mustRunAfterTest false
}
- Maven local installation
gradle or gradle publishToMavenlocal
- Publishing to Plugin portal
gradle clean build -Prelease=true publishPlugins
- Publishing to Bintray JCenter
gradle clean build -Prelease=true bintrayUpload
See CHANGELOG