diff --git a/testsuite/Jenkinsfile b/testsuite/Jenkinsfile index 2aec1d1..4e6dc4c 100644 --- a/testsuite/Jenkinsfile +++ b/testsuite/Jenkinsfile @@ -16,157 +16,80 @@ pipeline { } agent none stages { - stage('Setup') { - parallel { - stage('setup miniconda on daint') { - agent { label 'daint' } - environment { - PATH = "$WORKSPACE/miniconda_$NODE_NAME/bin:$PATH" - } - steps { - script { - BuildBadge.setStatus('running') - } - sh 'testsuite/setup.sh' - } - post { - failure { - echo 'Cleaning up workspace' - deleteDir() - } - } - } - stage('setup miniconda on tsa') { - agent { label 'tsa' } - environment { - PATH = "$WORKSPACE/miniconda_$NODE_NAME/bin:$PATH" - } - steps { - script { - BuildBadge.setStatus('running') - } - sh 'testsuite/setup.sh' - } - post { - failure { - echo 'Cleaning up workspace' - deleteDir() - } + stage('Test') { + matrix { + agent { label "$NODE_NAME" } + axes { + axis { + name 'NODE_NAME' + values 'tsa', 'daint' } } - } - post { - failure { - node('tsa') { + post { + unsuccessful { + mail bcc: '', + body: "Jenkins Failure
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
Build URL: ${env.BUILD_URL}" , + cc: "${EMAIL_TO_2}", charset: 'UTF-8', from: '', mimeType: 'text/html', + replyTo: '', subject: "Jenkins Job Failure ${NODE_NAME} -> ${env.JOB_NAME}", + to: "${EMAIL_TO_1}"; script { BuildBadge.setStatus('failing') } } - } - success { - node('tsa') { + success { + mail bcc: '', + body: "Jenkins Success
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
Build URL: ${env.BUILD_URL}" , + cc: "${EMAIL_TO_2}", charset: 'UTF-8', from: '', mimeType: 'text/html', + replyTo: '', subject: "Jenkins Job Success ${NODE_NAME} ->${env.JOB_NAME}", + to: "${EMAIL_TO_1}"; script { BuildBadge.setStatus('passing') } } - } - } - } - stage('Test') { - parallel { - stage('test on daint') { - agent { label 'daint' } - environment { - PATH = "$WORKSPACE/miniconda_${NODE_NAME}/bin:$PATH" + always { + archiveArtifacts artifacts: '*.log', allowEmptyArchive: true + echo 'Cleaning up workspace' + deleteDir() } - steps { - script { - TestBadge.setStatus('running') + } + stages { + stage('setup miniconda') { + options { + timeout(time: 4, unit: 'HOURS') } - sh 'testsuite/test.sh' - } - post { - success { - mail bcc: '', - body: "Jenkins Success
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
Build URL: ${env.BUILD_URL}" , - cc: "${EMAIL_TO_2}", charset: 'UTF-8', from: '', mimeType: 'text/html', - replyTo: '', subject: "Jenkins Job Success ${NODE_NAME} ->${env.JOB_NAME}", - to: "${EMAIL_TO_1}"; + environment { + PATH = "$WORKSPACE/miniconda_$NODE_NAME/bin:$PATH" } - failure { + steps { script { - mail bcc: '', - body: "Jenkins Failure
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
Build URL: ${env.BUILD_URL}" , - cc: "${EMAIL_TO_2}", charset: 'UTF-8', from: '', mimeType: 'text/html', - replyTo: '', subject: "Jenkins Job Failure ${NODE_NAME} -> ${env.JOB_NAME}", - to: "${EMAIL_TO_1}"; + BuildBadge.setStatus('running') } - - } - always { - archiveArtifacts artifacts: '*.log', allowEmptyArchive: true - echo 'Cleaning up workspace' - deleteDir() + sh 'testsuite/setup.sh' } - } - } - stage('test on tsa') { - agent { label 'tsa' } - environment { - PATH = "$WORKSPACE/miniconda_${NODE_NAME}/bin:$PATH" - } - steps { - script { - TestBadge.setStatus('running') + post { + failure { + archiveArtifacts artifacts: '*.log', allowEmptyArchive: true + echo 'Cleaning up workspace' + deleteDir() + } } - sh 'testsuite/test.sh' } - post { - success { - mail bcc: '', - body: "Jenkins Success
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
Build URL: ${env.BUILD_URL}" , - cc: "${EMAIL_TO_2}", charset: 'UTF-8', from: '', mimeType: 'text/html', - replyTo: '', subject: "Jenkins Job Success ${NODE_NAME} ->${env.JOB_NAME}", - to: "${EMAIL_TO_1}"; - } - failure { - mail bcc: '', - body: "Jenkins Failure
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
Build URL: ${env.BUILD_URL}" , - cc: "${EMAIL_TO_2}", charset: 'UTF-8', from: '', mimeType: 'text/html', - replyTo: '', subject: "Jenkins Job Failure ${NODE_NAME} -> ${env.JOB_NAME}", - to: "${EMAIL_TO_1}"; + stage('run tests') { + options { + timeout(time: 10, unit: 'MINUTES') } - always { - archiveArtifacts artifacts: '*.log', allowEmptyArchive: true - echo 'Cleaning up workspace' - deleteDir() + environment { + PATH = "$WORKSPACE/miniconda_${NODE_NAME}/bin:$PATH" } - } - } - } - post { - failure { - node('tsa') { - script { - TestBadge.setStatus('failing') - } - } - } - success { - node('tsa') { - script { - TestBadge.setStatus('passing') + steps { + script { + TestBadge.setStatus('running') + } + sh 'testsuite/test.sh' } } } } } } - post { - always { - node('tsa') { - deleteDir() - } - } - } }