From 45bf813c0a257692ca10f7424fe9fe19258ac710 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 19 Feb 2025 08:23:08 +0100 Subject: [PATCH] ci: refs #6695 streamline Cypress E2E test execution in Jenkinsfile and improve error handling --- Jenkinsfile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 87cde918d..0c1774367 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -111,16 +111,17 @@ pipeline { steps { script { sh "docker-compose -p ${env.NETWORK} -f docker-compose.e2e.yml up -d" - def containerId = sh(script: ''' + def currentDir = sh(script: "pwd", returnStdout: true).trim() + def containerId = sh(script: """ docker run --network ${env.NETWORK}_e2e-network \ - -e TZ=Europe/Madrid \ - -e DOCKER=true \ - -e CI=true \ - -v ${PWD}:/app \ - -w /app \ - cypress-setup:latest \ - sh -c "while [ ! -d node_modules/cypress ]; do sleep 1; done && pnpm exec cypress run --browser chromium" - ''', returnStdout: true).trim() + -e TZ=Europe/Madrid \ + -e DOCKER=true \ + -e CI=true \ + -v ${currentDir}:/app \ + -w /app \ + cypress-setup:latest \ + sh -c "while [ ! -d node_modules/cypress ]; do sleep 1; done && pnpm exec cypress run --browser chromium" + """, returnStdout: true).trim() checkErrors(containerId) } }