Skip to content

Instantly share code, notes, and snippets.

@elderfo
Created February 20, 2018 18:20
Show Gist options
  • Save elderfo/08bff7eb0f65743abbf7fa521a567a6a to your computer and use it in GitHub Desktop.
Save elderfo/08bff7eb0f65743abbf7fa521a567a6a to your computer and use it in GitHub Desktop.
Integration Test Source Set for Gradle
apply plugin: 'java'
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
sourceSets {
integrationTest {
java.srcDir file('src/integration-test/java')
resources.srcDir file('src/integration-test/resources')
compileClasspath += sourceSets.main.output + sourceSets.test.output + configurations.testRuntime
runtimeClasspath += sourceSets.main.output + sourceSets.test.output + configurations.testRuntime
}
}
task integrationTest(type: Test) {
group 'Verification'
description 'Runs the integration tests.'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}
@idrabenia
Copy link

Hi,

There are possible to add all described staff by single line with this plugin.
https://github.com/Softeq/itest-gradle-plugin
https://softeq.github.io/itest-gradle-plugin/

- Ilya

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment