Skip to content

Commit

Permalink
don't fail build on test error
Browse files Browse the repository at this point in the history
  • Loading branch information
EcljpseB0T authored and jukzi committed Feb 7, 2024
1 parent 9d9f4ff commit 26600a5
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,28 @@ pipeline {
steps {
wrap([$class: 'Xvnc', useXauthority: true]) {
sh """
mvn -U -e -Dmaven.compiler.failOnWarning=false -DskipTests=false -Dmaven.repo.local=$WORKSPACE/.m2/repository \
clean verify --batch-mode -Pbuild-individual-bundles -Pbree-libs -Papi-check -Dcompare-version-with-baselines.skip=false
mvn -U -e -DskipTests=false -Dmaven.repo.local=$WORKSPACE/.m2/repository \
clean verify --batch-mode --fail-at-end -Pbuild-individual-bundles \
-Pbree-libs -Papi-check -Pjavadoc \
-Dmaven.test.failure.ignore=true \
-Dcompare-version-with-baselines.skip=false
"""
}
}
post {
always {
archiveArtifacts artifacts: '*.log,*/target/work/data/.metadata/*.log,*/tests/target/work/data/.metadata/*.log,apiAnalyzer-workspace/.metadata/*.log', allowEmptyArchive: true
// The following lines use the newest build on master that did not fail a reference
// To not fail master build on failed test maven needs to be started with "-Dmaven.test.failure.ignore=true" it will then only marked unstable.
// To not fail the build also "unstable: true" is used to only mark the build unstable instead of failing when qualityGates are missed
// Also do not record mavenConsole() as failing tests are logged with ERROR duplicating the failure into the "Maven" plugin
// To accept unstable builds (test errors or new warnings introduced by third party changes) as reference using "ignoreQualityGate:true"
// To only show warnings related to the PR on a PR using "publishAllIssues:false"
// The eclipse compiler name is changed because the logfile not only contains ECJ but also API warnings.
// "pattern:" is used to collect warnings in dedicated files avoiding output of junit tests treated as warnings
junit '**/target/surefire-reports/*.xml'
discoverGitReferenceBuild referenceJob: 'eclipse.jdt.ui-github/master'
recordIssues publishAllIssues:false, ignoreQualityGate:true, tool: eclipse(name: 'Compiler and API Tools', pattern: '**/target/compilelogs/*.xml'), qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]]
recordIssues publishAllIssues:false, ignoreQualityGate:true, tool: javaDoc(), qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]]
recordIssues publishAllIssues:false, ignoreQualityGate:true, tool: mavenConsole(), qualityGates: [[threshold: 1, type: 'DELTA_ERROR', unstable: true]]
}
}
}
Expand Down

0 comments on commit 26600a5

Please sign in to comment.