Skip to content

Commit

Permalink
CONFLUENT: Jenkins gradle exit 1 on executor failure, 0 on test failu…
Browse files Browse the repository at this point in the history
…re (#531) (#215)

We wish to return a yellow build on a test failure, but wish to fail the
build completely when the gradle executors do not finish cleanly. This
change will achieve that.
(cherry picked from commit 334acf48d40e6a3c627cb71990fa91e1616e4921)

-- This also changes max number of forks to 4, to improve build stability
  • Loading branch information
gwenshap committed Jul 21, 2019
1 parent 7a499af commit 10ab08b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@ def job = {
}
}

stage("Unit Test") {
sh "./gradlew --no-daemon unitTest --continue --stacktrace || true"
}

stage("Integration test") {
sh "./gradlew integrationTest " +
"--no-daemon --stacktrace --continue -PtestLoggingEvents=started,passed,skipped,failed -PmaxParallelForks=6 || true"
stage("Test") {
sh "./gradlew unitTest integrationTest " +
"--no-daemon --stacktrace --continue -PtestLoggingEvents=started,passed,skipped,failed -PmaxParallelForks=4 -PignoreFailures=true"
}
}

Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ ext {
buildVersionFileName = "kafka-version.properties"

userMaxForks = project.hasProperty('maxParallelForks') ? maxParallelForks.toInteger() : null
userIgnoreFailures = project.hasProperty('ignoreFailures') ? ignoreFailures : false

skipSigning = project.hasProperty('skipSigning') && skipSigning.toBoolean()
shouldSign = !skipSigning && !version.endsWith("SNAPSHOT") && project.gradle.startParameter.taskNames.any { it.contains("upload") }
Expand Down Expand Up @@ -313,6 +314,7 @@ subprojects {

task integrationTest(type: Test, dependsOn: compileJava) {
maxParallelForks = userMaxForks ?: Runtime.runtime.availableProcessors()
ignoreFailures = userIgnoreFailures

minHeapSize = "256m"
maxHeapSize = "2048m"
Expand All @@ -332,6 +334,7 @@ subprojects {

task unitTest(type: Test, dependsOn: compileJava) {
maxParallelForks = userMaxForks ?: Runtime.runtime.availableProcessors()
ignoreFailures = userIgnoreFailures

minHeapSize = "256m"
maxHeapSize = "2048m"
Expand Down

0 comments on commit 10ab08b

Please sign in to comment.