Slackbot
02/11/2022, 4:18 PMVampire
02/11/2022, 4:44 PMtest
test suite for unit tests has
testCompileClasspath.extendsFrom(implementation, compileOnlyApi)
testRuntimeClasspath.extendsFrom(implementation, runtimeOnly)
You probably want something similar.Daniel Svensson
02/11/2022, 4:49 PMregister("integrationTest", JvmTestSuite::class) { dependencies { .. } }
block?Daniel Svensson
02/11/2022, 4:50 PMtestCompileClasspath
for example.Vampire
02/11/2022, 4:56 PMVampire
02/11/2022, 5:01 PMval integrationTestCompileClasspath by configurations.getting {
extendsFrom(configurations.implementation.get())
extendsFrom(configurations.compileOnlyApi.get())
}
val integrationTestRuntimeClasspath by configurations.getting {
extendsFrom(configurations.implementation.get())
extendsFrom(configurations.runtimeOnly.get())
}
Daniel Svensson
02/11/2022, 5:08 PMDaniel Svensson
02/11/2022, 5:10 PMextendsFrom(configurations.testImplementation.get())
did at least not help.Daniel Svensson
02/11/2022, 5:12 PMDaniel Svensson
02/11/2022, 5:14 PMwithType(Test::class.java) { systemProperty("...", "...") }
aren't set when executing like this. That can probably be fixed. Thanks for the help.Vampire
02/11/2022, 10:56 PMI don't get why so many examples prefer declaring a variable for such thingsClearer to read, no "hard-coded string" but a variable name, can be used for other configurations, and usually they are not highlighted as unused, because they are used. Their name is used by the delegate mechanism. If it is shown as unused, that usually means there is a bug in the Kotlin IntelliJ plugin you should report. But in this case, the plugin got it correctly, no unused warning:
Vampire
02/11/2022, 10:58 PMAh, I suspect some properties that i set viaWhile I preferaren't set when executing like this. That can probably be fixed. Thanks for the help.withType(Test::class.java) { systemProperty("...", "...") }
withType<Test> { ... }
for readability, both are equally fine and should configure all tasks of type Test
, including the integration test ones.