From de7e2643914b406a13e0f356982a01008eca1684 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 28 Feb 2025 11:01:05 +0100 Subject: [PATCH] refactor: refs #6695 streamline Cypress test execution and remove deprecated configurations --- Jenkinsfile | 1 - cypress.config.js | 8 -------- test/cypress/cypressParallel.sh | 5 ----- test/cypress/run.sh | 10 ++++++---- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6278584a8..c27d467ee 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -118,7 +118,6 @@ pipeline { def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs') sh "docker-compose ${env.COMPOSE_PARAMS} up -d" image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") { - // sh 'cypress run --browser chromium || true' sh '''#!/bin/bash source test/cypress/cypressParallel.sh cypressParallel 2 || true diff --git a/cypress.config.js b/cypress.config.js index 6db1dd86f..3133d46a4 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -69,13 +69,5 @@ export default defineConfig({ ...timeouts, includeShadowDom: true, waitForAnimations: true, - setupNodeEvents(on, config) { - on('before:browser:launch', (browser = {}, launchOptions) => { - launchOptions.args.push('--disable-gpu'); - launchOptions.args.push('--no-sandbox'); - - return launchOptions; - }); - }, }, }); diff --git a/test/cypress/cypressParallel.sh b/test/cypress/cypressParallel.sh index 81dc10664..90fb383f8 100644 --- a/test/cypress/cypressParallel.sh +++ b/test/cypress/cypressParallel.sh @@ -1,9 +1,4 @@ cypressParallel() { - TEST_PATHS=( - 'test/cypress/integration/client/*.spec.js' - ) - # printf "%s\n" "${TEST_PATHS[@]}" | xargs -P $1 -I {} sh -c 'xvfb-run -a cypress run --headless --browser chromium --spec {}' - # find 'test/cypress/integration' -name "*.spec.js" | xargs -P "$1" -I {} sh -c 'echo "🔷 {}" && xvfb-run -a cypress run --headless --browser chromium --spec "{}" --quiet > /dev/null 2>&1' find 'test/cypress/integration' -mindepth 1 -maxdepth 1 -type d | xargs -P "$1" -I {} sh -c 'echo "🔷 {}" && xvfb-run -a cypress run --headless --browser chromium --spec "{}" --quiet > /dev/null 2>&1' wait } diff --git a/test/cypress/run.sh b/test/cypress/run.sh index 2a2703d10..4c9c26416 100644 --- a/test/cypress/run.sh +++ b/test/cypress/run.sh @@ -1,5 +1,4 @@ #!/bin/bash -CYPRESS_SPEC_FOLDER="test/cypress/integration" cleanup() { docker-compose -p e2e --project-directory . -f test/cypress/docker-compose.yml down || true } @@ -13,13 +12,16 @@ rm -rf test/cypress/reports rm -rf junit #RUN -CI=true TZ=Europe/Madrid docker-compose -p e2e --project-directory . -f test/cypress/docker-compose.yml up -d +export CI=true +export TZ=Europe/Madrid + +docker-compose -p e2e --project-directory . -f test/cypress/docker-compose.yml up -d docker run -it --rm \ -v "$(pwd)":/app \ - -e CI=true \ - -e TZ=Europe/Madrid \ --network e2e_default \ + -e CI \ + -e TZ \ lilium-dev \ bash -c ' source test/cypress/cypressParallel.sh