Gradle 4.7
I’m currently running into an issue when following the guide here on how to create an integration test configuration/task:
https://docs.gradle.org/current/userguide/java_testing.html#sec:configuring_java_integration_tests
sourceSets {
"integration-test" {
compileClasspath += main.output + test.output + configurations.testRuntime
runtimeClasspath += output + compileClasspath
}
}
configurations {
integrationTestImplementation.extendsFrom implementation
integrationTestImplementation.extendsFrom testImplementation
}
task integrationTest(type: Test) {
testClassesDirs = sourceSets."integration-test".output.classesDirs
classpath = sourceSets."integration-test".runtimeClasspath
}
dependencies {
implementation project(":client")
}
Whenever I run ./gradlew build integrationTest
, the tests fail to compile missing classes defined in the client project. Whenever I run ./gradlew integrationTest
, the tests compile properly, and pass.
I’m at my wits end trying to figure out why this is failing. The project is in the integrationTestCompileClasspath dependency, so I don’t see why it would be unable to reference those classes.
Thanks!