The main goal of project is to provide implemenation of integration task in gradle
- language: groovy
- dedicated structure for source files and resources
- separate dependency configuration
- use classpath from main sources files
- unique task for running integration tests
verification
task group- excluded from incremental gradle build mechanism
- run before
check
- groovy + dedicated structure for source files and resources (
src/intTest
)intTest { groovy { srcDir "src/intTest/groovy" } resources { srcDir "src/intTest/resources" }
- separate dependency configuration
Remark:
configurations { intTestCompile.extendsFrom testCompile intTestCompile.extendsFrom integrationTestCompile, testRuntime intTestImplementation.extendsFrom implementation intTestRuntimeOnly.extendsFrom runtimeOnly } dependencies { ... intTestCompile group: 'org.codehaus.groovy', name: 'groovy', version: '2.4.15' intTestCompile group: 'org.spockframework', name: 'spock-core', version: '1.1-groovy-2.4' }
configurations
should be beforedependencies
section - use classpath from main sources files
sourceSets { intTest { ... compileClasspath += sourceSets.main.output + configurations.intTestCompile runtimeClasspath += sourceSets.main.output + configurations.intTestRuntime } }
- unique task for running integration tests
task integrationTest(type: Test) { ... }
verification
task grouptask integrationTest(type: Test) { description = 'Integration tests' group = 'verification' ... }
- excluded from incremental gradle build mechanism
task integrationTest(type: Test) { ... outputs.upToDateWhen {false} }
- run before
check
check.dependsOn integrationTest