From 69e57154cfadacd2ba3239be2a028e1c32159d5a Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 10 Feb 2025 15:23:39 +0100 Subject: [PATCH] fix: refs #6695 try parallel --- Jenkinsfile | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index db197c887..5c29f85c7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -111,17 +111,7 @@ pipeline { steps { script { runTestsInParallel() - def containerId = sh(script: "docker-compose -p ${env.NETWORK} -f docker-compose.e2e.yml ps -q e2e", returnStdout: true).trim() - if (containerId) { - def exitCode = sh(script: "docker inspect -f '{{.State.ExitCode}}' ${containerId}", returnStdout: true).trim() - sh "docker cp ${containerId}:/app/test/cypress/reports ./test/cypress/" - if (exitCode != '0') { - def logs = sh(script: "docker logs ${containerId}", returnStdout: true).trim() - error("Cypress E2E tests failed with exit code: ${exitCode}\nLogs:\n${logs}") - } - } else { - error("The Docker container for E2E tests could not be created") - } + } } } @@ -202,7 +192,7 @@ def cleanDockerE2E() { def runTestsInParallel() { // def integrationTests = sh(script: "ls -d test/cypress/integration/*/ || echo ''", returnStdout: true).trim().split('\n') - def integrationTests = ['test/cypress/integration/claim/', 'test/cypress/integration/client/'] + def integrationTests = ['test/cypress/integration/claim/', 'test/cypress/integration/client/', 'test/cypress/integration/entry/', 'test/cypress/integration/invoiceIn/'] def tasks = [:] integrationTests.each { testFolder -> @@ -215,6 +205,7 @@ def runTestsInParallel() { sh "docker-compose -p ${env.NETWORK}_${folderName} -f docker-compose.e2e.yml up -d back" sh "docker-compose -p ${env.NETWORK}_${folderName} -f docker-compose.e2e.yml up -d front" sh "CYPRESS_SPEC=test/cypress/integration/${folderName}/**/*.spec.js docker-compose -p ${env.NETWORK}_${folderName} -f docker-compose.e2e.yml up e2e" + checkErrors() } } } @@ -222,3 +213,18 @@ def runTestsInParallel() { parallel tasks } + +def checkErrors(){ + def containerId = sh(script: "docker-compose -p ${env.NETWORK}_${folderName} -f docker-compose.e2e.yml ps -q e2e", returnStdout: true).trim() + if (containerId) { + def exitCode = sh(script: "docker inspect -f '{{.State.ExitCode}}' ${containerId}", returnStdout: true).trim() + sh "docker cp ${containerId}:/app/test/cypress/reports ./test/cypress/" + if (exitCode != '0') { + def logs = sh(script: "docker logs ${containerId}", returnStdout: true).trim() + error("Cypress E2E tests failed with exit code: ${exitCode}\nLogs:\n${logs}") + } + } else { + error("The Docker container for E2E tests could not be created") + } +} +