Jenkinsfile: publish test results only one time (#60129)

This commit is contained in:
Benjamin Dauvergne 2022-01-25 10:21:33 +01:00
parent 549515cb86
commit b9845dbfff
1 changed files with 10 additions and 28 deletions

38
Jenkinsfile vendored
View File

@ -7,7 +7,7 @@ pipeline {
TMPDIR = "/tmp/${JOB_NAME.take(32)}-${BUILD_NUMBER}"
}
stages {
stage('Unit Tests (main targets)') {
stage('Tests (main)') {
steps {
sh "mkdir -p ${env.TMPDIR}"
sh """
@ -15,19 +15,8 @@ python3 -m venv ${env.TMPDIR}/venv/
${env.TMPDIR}/venv/bin/pip install tox
PGPORT=`python3 -c 'import struct; import socket; s=socket.socket(); s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack("ii", 1, 0)); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'` pg_virtualenv -o fsync=off ${env.TMPDIR}/venv/bin/tox -rv"""
}
post {
always {
script {
utils = new Utils()
utils.publish_coverage('coverage.xml')
utils.publish_coverage_native('index.html')
utils.publish_pylint('pylint.out')
}
mergeJunitResults()
}
}
}
stage('Unit Tests (nightly)') {
stage('Tests (nightly)') {
when { triggeredBy 'TimerTrigger' }
steps {
sh """
@ -43,17 +32,6 @@ PGPORT=`python3 -c 'import struct; import socket; s=socket.socket(); s.setsockop
}
}
}
post {
always {
script {
utils = new Utils()
utils.publish_coverage('coverage.xml')
utils.publish_coverage_native('index.html')
utils.publish_pylint('pylint.out')
}
mergeJunitResults()
}
}
}
stage('Packaging') {
steps {
@ -69,10 +47,14 @@ PGPORT=`python3 -c 'import struct; import socket; s=socket.socket(); s.setsockop
}
post {
always {
script {
utils = new Utils()
utils.mail_notify(currentBuild, env, 'ci+jenkins-authentic@entrouvert.org')
}
script {
utils = new Utils()
utils.mail_notify(currentBuild, env, 'ci+jenkins-authentic@entrouvert.org')
utils.publish_coverage('coverage.xml')
utils.publish_coverage_native('index.html')
utils.publish_pylint('pylint.out')
}
mergeJunitResults()
}
cleanup {
sh "rm -rf ${env.TMPDIR}"