Skip to content

Commit

Permalink
feat(gradle): add "ignoreFailures" parameter for "test" in build.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoscode committed Oct 27, 2023
1 parent e86ab2d commit 5819662
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ plugins {
group = "${groupName}"
version = "${applicationVersion}"
sourceCompatibility = JavaVersion.VERSION_17

// Fetch the environment variables GITHUB_USERNAME, GITHUB_TOKEN
// these can be set in <project_root>/.env
// or export GITHUB_USERNAME=...
Expand Down Expand Up @@ -207,6 +208,11 @@ bootJar {
test {
useJUnitPlatform()
finalizedBy jacocoTestReport

if (project.hasProperty('testIgnoreFailures')) {
ignoreFailures = true
project.logger.lifecycle("Ignoring test failures...")
}
}

// standard gradle class
Expand All @@ -218,15 +224,16 @@ htmlDependencyReport {
// 'jacocoTestReport' is provided by the 'jacoco' plugin
// docs: https://docs.gradle.org/current/userguide/jacoco_plugin.html
jacocoTestReport {
dependsOn test

reports {
xml.enabled true
xml.outputLocation = layout.buildDirectory.dir("${buildDir}/reports/xml/jacoco")
xml.outputLocation = file("./build/reports/xml/jacoco")

csv.enabled false

html.enabled true
html.outputLocation = layout.buildDirectory.dir("${buildDir}/reports/html/jacoco")
html.outputLocation = file("./build/reports/html/jacoco")
}

afterEvaluate {
Expand All @@ -245,7 +252,6 @@ jacocoTestReport {
// docs: https://docs.gradle.org/current/userguide/jacoco_plugin.html#sec:configuring_the_jacoco_plugin
jacoco {
toolVersion = "${jacocoVersion}"

}


Expand Down

0 comments on commit 5819662

Please sign in to comment.