Jenkins: Archive JUnit results also on failing tests

This commit is contained in:
Johannes Schnatterer 2017-10-10 16:46:19 +02:00
parent e92ae405dd
commit ef3e3defd4

24
Jenkinsfile vendored
View file

@ -1,9 +1,11 @@
#!groovy
node {
cesFqdn = "ecosystem.cloudogu.net";
cesUrl = "https://${cesFqdn}";
credentials = usernamePassword(credentialsId: 'scmCredentials', passwordVariable: 'PASSWORD', usernameVariable: 'USERNAME');
cesFqdn = "ecosystem.cloudogu.net"
cesUrl = "https://${cesFqdn}"
credentials = usernamePassword(credentialsId: 'scmCredentials', passwordVariable: 'PASSWORD', usernameVariable: 'USERNAME')
catchError {
stage('Checkout') {
checkout scm
@ -21,18 +23,12 @@ node {
stage('Test') {
String jacoco = "org.jacoco:jacoco-maven-plugin:0.7.7.201606060606";
mvn "${jacoco}:prepare-agent test ${jacoco}:report"
// Archive JUnit results, if any
junit allowEmptyResults: true, testResults: '**/target/surefire-reports/TEST-*.xml'
}
},
integrationTest: {
stage('Integration Test') {
String jacoco = "org.jacoco:jacoco-maven-plugin:0.7.7.201606060606";
mvn "${jacoco}:prepare-agent-integration failsafe:integration-test ${jacoco}:report-integration"
// Archive JUnit results, if any
junit allowEmptyResults: true, testResults: '**/target/failsafe-reports/TEST-*.xml'
}
}
)
@ -60,11 +56,15 @@ node {
}
}
)
}
// Archive Unit and integration test results, if any
junit allowEmptyResults: true, testResults: '**/target/failsafe-reports/TEST-*.xml,**/target/surefire-reports/TEST-*.xml'
}
String cesFqdn;
String cesUrl;
def credentials;
String cesFqdn
String cesUrl
def credentials
void mvn(String args) {
writeSettingsXml()