Skip to content

Commit

Permalink
[build] Test failures make the build 'unstable', not 'failed'; remove…
Browse files Browse the repository at this point in the history
…d obsolete Slack notifications
  • Loading branch information
spoenemann committed Sep 5, 2017
1 parent 7766cda commit 89663f6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
38 changes: 15 additions & 23 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
// Tell Jenkins how to build projects from this repository
node {
try {
properties([
[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', numToKeepStr: '15']]
])

stage 'Checkout'
properties([
[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', numToKeepStr: '15']]
])

stage('Checkout') {
checkout scm

stage 'Gradle Build'
try {
sh "./gradlew clean cleanGenerateXtext build createLocalMavenRepo -PuseJenkinsSnapshots=true -PcompileXtend=true --refresh-dependencies --continue"
} finally {
step([$class: 'JUnitResultArchiver', testResults: '**/build/test-results/test/*.xml'])
}

stage 'Maven Build'
}

stage('Gradle Build') {
sh "./gradlew clean cleanGenerateXtext build createLocalMavenRepo -PuseJenkinsSnapshots=true -PcompileXtend=true -PignoreTestFailures=true --refresh-dependencies --continue"
step([$class: 'JUnitResultArchiver', testResults: '**/build/test-results/test/*.xml'])
}

stage('Maven Build') {
def mvnHome = tool 'M3'
env.M2_HOME = "${mvnHome}"
dir('.m2/repository/org/eclipse/xtext') { deleteDir() }
sh "${mvnHome}/bin/mvn -f releng --batch-mode --update-snapshots -Dmaven.repo.local=.m2/repository clean install"

archive 'build/**'
slackSend "Build Succeeded - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"

} catch (e) {
slackSend color: 'danger', message: "Build Failed - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
throw e
}

archive 'build/**'
}
6 changes: 6 additions & 0 deletions gradle/java-compiler-settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,9 @@ sourceSets.main.compileClasspath += configurations.optional
sourceSets.test.compileClasspath += configurations.optional
sourceSets.test.runtimeClasspath += configurations.optional
javadoc.classpath += configurations.optional

if (findProperty('ignoreTestFailures') == 'true') {
tasks.withType(Test) {
ignoreFailures = true
}
}

0 comments on commit 89663f6

Please sign in to comment.