Skip to content

Commit

Permalink
Move pitest to separate plugin (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfvanek authored Jan 1, 2024
1 parent 4fa0ee6 commit 03fd458
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ dependencies {
implementation(it)
}

testImplementation("org.assertj:assertj-core:3.24.2")
testImplementation(platform("org.mockito:mockito-bom:5.7.0"))
testImplementation("org.assertj:assertj-core:3.25.0")
testImplementation(platform("org.mockito:mockito-bom:5.8.0"))
testImplementation(platform("org.junit:junit-bom:5.10.1"))
testImplementation("org.junit.jupiter:junit-jupiter-api")

testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")

checkstyle("com.thomasjensen.checkstyle.addons:checkstyle-addons:7.0.1")
errorprone("com.google.errorprone:error_prone_core:2.23.0")
errorprone("com.google.errorprone:error_prone_core:2.24.0")
}

java {
Expand All @@ -44,7 +44,7 @@ tasks.withType<JavaCompile>().configureEach {
options.compilerArgs.add("-parameters")
options.errorprone {
disableWarningsInGeneratedCode.set(true)
disable("StringSplitter", "ImmutableEnumChecker", "FutureReturnValueIgnored", "EqualsIncompatibleType")
disable("StringSplitter", "ImmutableEnumChecker", "FutureReturnValueIgnored", "EqualsIncompatibleType", "TruthSelfEquals")
}
}

Expand Down
31 changes: 31 additions & 0 deletions buildSrc/src/main/kotlin/pg-index-health.pitest.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import info.solidsoft.gradle.pitest.PitestTask

plugins {
id("java-library")
id("info.solidsoft.pitest")
}

dependencies {
pitest("it.mulders.stryker:pit-dashboard-reporter:0.2.1")
}

pitest {
junit5PluginVersion.set("1.2.1")
pitestVersion.set("1.15.3")
threads.set(4)
if (System.getenv("STRYKER_DASHBOARD_API_KEY") != null) {
outputFormats.set(setOf("stryker-dashboard"))
} else {
outputFormats.set(setOf("HTML"))
}
timestampedReports.set(false)
mutationThreshold.set(100)
}

tasks.withType<PitestTask>().configureEach {
mustRunAfter(tasks.test)
}

tasks.build {
dependsOn("pitest")
}
5 changes: 0 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[versions]
pitest-junit5Plugin = "1.2.1"
pitest-core = "1.15.3"

[libraries]
jsr305 = "com.google.code.findbugs:jsr305:3.0.2"
postgresql = "org.postgresql:postgresql:42.7.1"
Expand All @@ -11,4 +7,3 @@ apache-commons-dbcp2 = "org.apache.commons:commons-dbcp2:2.11.0"
awaitility = "org.awaitility:awaitility:4.2.0"
apache-commons-lang3 = "org.apache.commons:commons-lang3:3.14.0"
equalsverifier = "nl.jqno.equalsverifier:equalsverifier:3.15.5"
pitest-dashboard-reporter = "it.mulders.stryker:pit-dashboard-reporter:0.2.1"
23 changes: 1 addition & 22 deletions pg-index-health-generator/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import info.solidsoft.gradle.pitest.PitestTask

plugins {
id("pg-index-health.java-conventions")
id("pg-index-health.publish")
id("info.solidsoft.pitest")
id("pg-index-health.pitest")
}

description = "pg-index-health-generator is an extension for generating database migrations in sql format based on pg-index-health diagnostics."
Expand All @@ -15,27 +13,8 @@ dependencies {
testImplementation(testFixtures(project(":pg-index-health-model")))
testImplementation(testFixtures(project(":pg-index-health-jdbc-connection")))
testImplementation(libs.logback.classic)

pitest(libs.pitest.dashboard.reporter)
}

pitest {
junit5PluginVersion.set(libs.versions.pitest.junit5Plugin.get())
pitestVersion.set(libs.versions.pitest.core.get())
threads.set(4)
if (System.getenv("STRYKER_DASHBOARD_API_KEY") != null) {
outputFormats.set(setOf("stryker-dashboard"))
} else {
outputFormats.set(setOf("HTML"))
}
timestampedReports.set(false)
mutationThreshold.set(96)
}

tasks.withType<PitestTask>().configureEach {
mustRunAfter(tasks.test)
}

tasks.build {
dependsOn("pitest")
}
23 changes: 1 addition & 22 deletions pg-index-health-jdbc-connection/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import info.solidsoft.gradle.pitest.PitestTask

plugins {
id("pg-index-health.java-conventions")
id("pg-index-health.publish")
id("info.solidsoft.pitest")
id("pg-index-health.pitest")
}

description = "pg-index-health-jdbc-connection is an abstraction of a connection to a high availability PostgreSQL cluster."
Expand All @@ -25,27 +23,8 @@ dependencies {
testFixturesImplementation(libs.jsr305)
testFixturesImplementation(libs.slf4j.api)
testFixturesImplementation(libs.logback.classic)

pitest(libs.pitest.dashboard.reporter)
}

pitest {
junit5PluginVersion.set(libs.versions.pitest.junit5Plugin.get())
pitestVersion.set(libs.versions.pitest.core.get())
threads.set(4)
if (System.getenv("STRYKER_DASHBOARD_API_KEY") != null) {
outputFormats.set(setOf("stryker-dashboard"))
} else {
outputFormats.set(setOf("HTML"))
}
timestampedReports.set(false)
mutationThreshold.set(98)
}

tasks.withType<PitestTask>().configureEach {
mustRunAfter(tasks.test)
}

tasks.build {
dependsOn("pitest")
}
27 changes: 1 addition & 26 deletions pg-index-health-model/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import info.solidsoft.gradle.pitest.PitestTask

plugins {
id("pg-index-health.java-conventions")
id("pg-index-health.publish")
id("info.solidsoft.pitest")
id("pg-index-health.pitest")
}

description = "pg-index-health-model is a set of common classes and interfaces for getting information about PostgreSQL database objects."
Expand All @@ -13,27 +11,4 @@ dependencies {
testImplementation("org.mockito:mockito-core")

testFixturesImplementation(libs.jsr305)

pitest(libs.pitest.dashboard.reporter)
}

pitest {
junit5PluginVersion.set(libs.versions.pitest.junit5Plugin.get())
pitestVersion.set(libs.versions.pitest.core.get())
threads.set(4)
if (System.getenv("STRYKER_DASHBOARD_API_KEY") != null) {
outputFormats.set(setOf("stryker-dashboard"))
} else {
outputFormats.set(setOf("HTML"))
}
timestampedReports.set(false)
mutationThreshold.set(100)
}

tasks.withType<PitestTask>().configureEach {
mustRunAfter(tasks.test)
}

tasks.build {
dependsOn("pitest")
}

0 comments on commit 03fd458

Please sign in to comment.