From 618926430c21132ff8732e1b0b8bed85ddc8fa75 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 14 Mar 2025 08:01:32 +0100 Subject: [PATCH 1/6] feat: refs #6695 clean up Cypress screenshots and archive artifacts in Jenkins pipeline --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 63577dad5..1add5ed63 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -115,6 +115,7 @@ pipeline { steps { script { sh 'rm -f junit/e2e-*.xml' + sh 'rm -rf test/cypress/screenshots' env.COMPOSE_TAG = PROTECTED_BRANCH.contains(env.CHANGE_TARGET) ? env.CHANGE_TARGET : 'dev' def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs') @@ -130,6 +131,7 @@ pipeline { post { always { sh "docker-compose ${env.COMPOSE_PARAMS} down -v" + archiveArtifacts artifacts: 'test/cypress/screenshots/**/*' junit( testResults: 'junit/e2e-*.xml', allowEmptyResults: true From 7bd4f088ebc9e6c2e7619fa6973e65357ec07136 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 14 Mar 2025 10:30:14 +0100 Subject: [PATCH 2/6] fix: refs #6695 update Cypress parallel test execution to run with a single instance --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1add5ed63..4b712d335 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -124,7 +124,7 @@ pipeline { sh "docker-compose ${env.COMPOSE_PARAMS} up -d" image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ --init") { - sh 'sh test/cypress/cypressParallel.sh 2' + sh 'sh test/cypress/cypressParallel.sh 1' } } } From 2c4ee50f46510b5e29c38298c569fc108c760f2e Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 14 Mar 2025 11:16:54 +0100 Subject: [PATCH 3/6] test: refs #6695 handle uncaught exceptions in logout.spec.js for better error management --- test/cypress/integration/outLogin/logout.spec.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/cypress/integration/outLogin/logout.spec.js b/test/cypress/integration/outLogin/logout.spec.js index 373f0cc93..b3583e4d3 100644 --- a/test/cypress/integration/outLogin/logout.spec.js +++ b/test/cypress/integration/outLogin/logout.spec.js @@ -24,12 +24,21 @@ describe('Logout', () => { }, }, statusMessage: 'AUTHORIZATION_REQUIRED', - }); + }).as('badRequest'); }); it('when token not exists', () => { + const exceptionHandler = (err) => { + if (err.code === 'AUTHORIZATION_REQUIRED') return; + }; + Cypress.on('uncaught:exception', exceptionHandler); + cy.get('.q-list').first().should('be.visible').click(); + cy.wait('@badRequest'); + cy.checkNotification('Authorization Required'); + + Cypress.off('uncaught:exception', exceptionHandler); }); }); }); From 58c3d47a2f66a2b05b289a77c633864919ba1d75 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 14 Mar 2025 11:23:15 +0100 Subject: [PATCH 4/6] fix: refs #6695 up with pull --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4b712d335..f34e3d6d8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -121,10 +121,10 @@ pipeline { def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs') sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' - sh "docker-compose ${env.COMPOSE_PARAMS} up -d" + sh "docker-compose ${env.COMPOSE_PARAMS} up -d --pull always" image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ --init") { - sh 'sh test/cypress/cypressParallel.sh 1' + sh 'sh test/cypress/cypressParallel.sh 2' } } } From fa8a3d219c8acb3bc6ecdac3dc9cd6481e900b1e Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 14 Mar 2025 11:25:31 +0100 Subject: [PATCH 5/6] fix: refs #6695 update Jenkinsfile to pull specific services before starting containers --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f34e3d6d8..b75a1b4dc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -121,7 +121,9 @@ pipeline { def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs') sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' - sh "docker-compose ${env.COMPOSE_PARAMS} up -d --pull always" + sh "docker-compose ${env.COMPOSE_PARAMS} pull back" + sh "docker-compose ${env.COMPOSE_PARAMS} pull db" + sh "docker-compose ${env.COMPOSE_PARAMS} up -d" image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ --init") { sh 'sh test/cypress/cypressParallel.sh 2' From 6240e32c40daec81935c5ea6dba6470efa4bf102 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 14 Mar 2025 12:59:50 +0100 Subject: [PATCH 6/6] ci: refs #6695 allow empty archive for Cypress screenshots in Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b75a1b4dc..7f4144a54 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -133,7 +133,7 @@ pipeline { post { always { sh "docker-compose ${env.COMPOSE_PARAMS} down -v" - archiveArtifacts artifacts: 'test/cypress/screenshots/**/*' + archiveArtifacts artifacts: 'test/cypress/screenshots/**/*', allowEmptyArchive: true junit( testResults: 'junit/e2e-*.xml', allowEmptyResults: true