gradle-pitest-plugin
gradle-pitest-plugin copied to clipboard
[question] Gradle test suites support?
I wonder if plugin supports Gradle testing suites? I have tests defined as follows:
testing {
suites {
withType<JvmTestSuite> {
useJUnitJupiter()
dependencies {
implementation(project())
implementation(libs.springBootStarterTest)
implementation(libs.kotestAssertions)
}
}
val test by getting(JvmTestSuite::class) {
testType = TestSuiteType.UNIT_TEST
useJUnitJupiter()
dependencies {
implementation(libs.kotestAssertions)
}
sources {
kotlin {
setSrcDirs(listOf("src/test/kotlin"))
}
}
}
val integrationTest by registering(JvmTestSuite::class) {
testType = TestSuiteType.INTEGRATION_TEST
dependencies {
implementation(libs.springBootDevtools)
implementation(libs.springBootTestcontainers)
implementation(libs.testcontainersJupiter)
implementation(libs.testcontainersMongodb)
implementation(libs.testcontainersRedis)
}
sources {
kotlin {
setSrcDirs(listOf("src/integrationTest/kotlin"))
}
}
}
val acceptanceTest by registering(JvmTestSuite::class) {
testType = TestSuiteType.FUNCTIONAL_TEST
dependencies {
implementation(libs.springBootDevtools)
}
sources {
kotlin {
setSrcDirs(listOf("src/acceptanceTest/kotlin"))
}
}
}
}
}
That's a good question. Gradle internally used by GPP (6.9.2) is "quite old" (due to the legacy CD mechanism used by the project).
Could you give it a try and paste your results (e.g. produced errors)?
@szpak I managed to put some non working example - https://github.com/kkocel/mutation-testing