gradle-pitest-plugin icon indicating copy to clipboard operation
gradle-pitest-plugin copied to clipboard

[question] Gradle test suites support?

Open kkocel opened this issue 1 year ago • 2 comments

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"))
                }
            }
        }
    }
}

kkocel avatar Oct 25 '24 09:10 kkocel

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 avatar Nov 01 '24 19:11 szpak

@szpak I managed to put some non working example - https://github.com/kkocel/mutation-testing

kkocel avatar Nov 07 '24 15:11 kkocel