ci: refs #6695 streamline Cypress E2E test execution in Jenkinsfile and improve error handling
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2025-02-19 08:23:08 +01:00
parent 736415c876
commit 45bf813c0a
1 changed files with 10 additions and 9 deletions

19
Jenkinsfile vendored
View File

@ -111,16 +111,17 @@ pipeline {
steps { steps {
script { script {
sh "docker-compose -p ${env.NETWORK} -f docker-compose.e2e.yml up -d" 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 \ docker run --network ${env.NETWORK}_e2e-network \
-e TZ=Europe/Madrid \ -e TZ=Europe/Madrid \
-e DOCKER=true \ -e DOCKER=true \
-e CI=true \ -e CI=true \
-v ${PWD}:/app \ -v ${currentDir}:/app \
-w /app \ -w /app \
cypress-setup:latest \ cypress-setup:latest \
sh -c "while [ ! -d node_modules/cypress ]; do sleep 1; done && pnpm exec cypress run --browser chromium" sh -c "while [ ! -d node_modules/cypress ]; do sleep 1; done && pnpm exec cypress run --browser chromium"
''', returnStdout: true).trim() """, returnStdout: true).trim()
checkErrors(containerId) checkErrors(containerId)
} }
} }