Skip to content
Snippets Groups Projects
Commit 80555253 authored by OZGCloud's avatar OZGCloud
Browse files

catch e2e error

parent 9dac661b
No related branches found
No related tags found
No related merge requests found
...@@ -271,6 +271,7 @@ pipeline { ...@@ -271,6 +271,7 @@ pipeline {
parallel { parallel {
stage('E2E-EA') { stage('E2E-EA') {
steps { steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
script { script {
def stageName = env.STAGE_NAME def stageName = env.STAGE_NAME
def bezeichner = env.EA_BEZEICHNER def bezeichner = env.EA_BEZEICHNER
...@@ -287,6 +288,7 @@ pipeline { ...@@ -287,6 +288,7 @@ pipeline {
} }
} }
} }
}
post { post {
always { always {
script { script {
...@@ -297,6 +299,7 @@ pipeline { ...@@ -297,6 +299,7 @@ pipeline {
} }
stage('E2E-main') { stage('E2E-main') {
steps { steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
script { script {
def stageName = env.STAGE_NAME def stageName = env.STAGE_NAME
def bezeichner = env.MAIN_BEZEICHNER def bezeichner = env.MAIN_BEZEICHNER
...@@ -313,6 +316,7 @@ pipeline { ...@@ -313,6 +316,7 @@ pipeline {
} }
} }
} }
}
post { post {
always { always {
script { script {
...@@ -666,8 +670,10 @@ String runTests(String bezeichner, String reportFolder, Integer dbPort) { ...@@ -666,8 +670,10 @@ String runTests(String bezeichner, String reportFolder, Integer dbPort) {
return true return true
} }
} catch (Exception e) { } catch (Exception e) {
sh "ls -l /root/.npm/_logs/*-debug.log" if (hasNpmDebugLog()) {
sh "cat /root/.npm/_logs/*-debug.log" sh "cat /root/.npm/_logs/*-debug.log"
}
return false return false
} }
} }
...@@ -851,3 +857,7 @@ String decodeString(String encoded) { ...@@ -851,3 +857,7 @@ String decodeString(String encoded) {
Map getElasticsearchSecret(String namespace) { Map getElasticsearchSecret(String namespace) {
return readJSON ( text: sh (script: "kubectl get secret elasticsearch-credentials -n ${namespace} -o jsonpath={.data}", returnStdout: true)) return readJSON ( text: sh (script: "kubectl get secret elasticsearch-credentials -n ${namespace} -o jsonpath={.data}", returnStdout: true))
} }
Boolean hasNpmDebugLog() {
return sh (script: "ls -l /root/.npm/_logs/*-debug.log", returnStatus: true) == env.SH_SUCCESS_STATUS_CODE as Integer
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment