1
0

configured pitest mutation testing

This commit is contained in:
Michael Hoennig
2022-08-26 16:06:27 +02:00
parent 2124d448bf
commit 9fb6610ec8
3 changed files with 51 additions and 19 deletions

View File

@ -7,6 +7,7 @@ plugins {
id "org.owasp.dependencycheck" version "7.1.2"
id "com.diffplug.spotless" version "6.10.0"
id 'jacoco'
id 'info.solidsoft.pitest' version '1.7.4'
id 'se.patrikerdes.use-latest-versions' version '0.2.18'
id 'com.github.ben-manes.versions' version '0.42.0'
}
@ -72,6 +73,8 @@ dependencies {
testImplementation 'org.testcontainers:postgresql'
testImplementation 'com.tngtech.archunit:archunit-junit5:1.0.0-rc1'
testImplementation 'io.rest-assured:spring-mock-mvc'
testImplementation 'org.hamcrest:hamcrest-core:2.2'
testImplementation 'org.pitest:pitest-junit5-plugin:1.0.0'
}
dependencyManagement {
@ -213,6 +216,36 @@ jacocoTestCoverageVerification {
}
}
// pitest mutation testing
pitest {
targetClasses = ['net.hostsharing.hsadminng.**']
excludedClasses = [
'net.hostsharing.hsadminng.config.**',
'net.hostsharing.hsadminng.generated.**'
]
targetTests = ['net.hostsharing.hsadminng.**.*UnitTest', 'net.hostsharing.hsadminng.**.*RestTest']
excludedTestClasses = ['**AcceptanceTest*', '**IntegrationTest*']
pitestVersion = '1.9.0'
junit5PluginVersion = '1.0.0'
threads = 4
// As Java unit tests are pretty pointless in our case, this maybe makes not much sense.
mutationThreshold = 31
coverageThreshold = 44
testStrengthThreshold = 76
outputFormats = ['XML', 'HTML']
timestampedReports = false
}
project.tasks.check.dependsOn(project.tasks.pitest)
project.tasks.pitest.doLast {
println "PiTest Mutation Report: file:///${project.rootDir}/build/reports/pitest/index.html"
}
// Dependency Versions Upgrade
useLatestVersions {
finalizedBy check