using catch on tests in jenkins

This commit is contained in:
Martin Bielik 2016-06-07 17:21:40 +02:00
parent c834c73802
commit 0355c35d41
1 changed files with 8 additions and 3 deletions

11
Jenkinsfile vendored
View File

@ -4,7 +4,12 @@ node {
stage 'Install dependencies'
sh 'npm install'
stage 'Run tests'
sh 'npm test || true'
step([$class: 'JUnitResultArchiver', testResults: 'target/*.xml'])
step([$class: 'ArtifactArchiver', artifacts: 'coverage/**/*', fingerprint: true])
try {
sh 'npm test'
} catch(Exception ex) {
echo ex
} finally {
step([$class: 'JUnitResultArchiver', testResults: 'target/*.xml'])
step([$class: 'ArtifactArchiver', artifacts: 'coverage/**/*', fingerprint: true])
}
}