diff --git a/Jenkinsfile b/Jenkinsfile index 6d39995005db0fb5c68f73fd57a2959aa265e153..a4877e5443337c14423be9902e16a25ef8cf13c6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,7 @@ def FAILED_STAGE def IMAGE_TAG def VERSION +def E2E_FAILED pipeline { agent { @@ -13,7 +14,6 @@ pipeline { BLUE_OCEAN_URL = "https://jenkins.ozg-sh.de/blue/organizations/jenkins/goofy/detail/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/pipeline" RELEASE_REGEX = /\d+.\d+.\d+/ SNAPSHOT_REGEX = /\d+.\d+.\d+-SNAPSHOT/ - E2E_FAILED = "" } options { @@ -98,7 +98,6 @@ pipeline { script { FAILED_STAGE=env.STAGE_NAME IMAGE_TAG = "${env.BRANCH_NAME}-${VERSION}" - println("IMAGE_TAG: ${IMAGE_TAG}") container("maven-17"){ configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { @@ -130,6 +129,7 @@ pipeline { steps { script { FAILED_STAGE = env.STAGE_NAME + E2E_FAILED = "" } container("k8s") { configFileProvider([configFile(fileId: 'jenkins-kuby-kubeconfig', variable: 'KUBE_CONFIG')]) { @@ -162,13 +162,14 @@ pipeline { } ) - if(runTests(stageName, 'einheitlicher-ansprechpartner') != '0') { - env.E2E_FAILED += "${stageName}, " - } + def testResult = runTests(stageName, 'einheitlicher-ansprechpartner') - print(env.E2E_FAILED) - shutdownEnvironment(namespace) + + if(testResult != "0") { + E2E_FAILED += "${stageName}, " + error("Fehler in Stage ${stageName}") + } } } post { @@ -181,14 +182,6 @@ pipeline { reportFiles: 'report.html', reportName: "Goofy E2E-Tests EA" ]) - - script { - if (env.E2E_FAILED) { - if (env.E2E_FAILED.contains(env.STAGE_NAME)) { - currentBuild.result = 'FAILURE' - } - } - } } } } @@ -209,13 +202,14 @@ pipeline { } ) - if(runTests(stageName, 'main-tests') != '0') { - env.E2E_FAILED += "${stageName}, " - } - - print(env.E2E_FAILED) + def testResult = runTests(stageName, 'main-tests') - shutdownEnvironment(namespace) + shutdownEnvironment(namespace) + + if(testResult != "0") { + E2E_FAILED += "${stageName}, " + error("Fehler in Stage ${stageName}") + } } } post { @@ -228,14 +222,6 @@ pipeline { reportFiles: 'report.html', reportName: "Goofy E2E-Tests main" ]) - - script { - if (env.E2E_FAILED) { - if (env.E2E_FAILED.contains(env.STAGE_NAME)) { - currentBuild.result = 'FAILURE' - } - } - } } } } @@ -243,8 +229,9 @@ pipeline { post { always { script { - if (env.E2E_FAILED) { - FAILED_STAGE = "E2E (${env.E2E_FAILED.substring(0, env.E2E_FAILED.length() - 2)})" + if (E2E_FAILED) { + FAILED_STAGE = "E2E (${E2E_FAILED.substring(0, E2E_FAILED.length() - 2)})" + error("Fehler in E2E-Tests") } } } @@ -381,7 +368,7 @@ Void startGoofy(String namespace, String values, String imageTag) { } } -Void runTests(String stageName, String reportFolder) { +String runTests(String stageName, String reportFolder) { container("cypress") { def configFile = generateCypressConfig(stageName, reportFolder) dir("goofy-client") { diff --git a/goofy-client/apps/goofy-e2e/cypress.json b/goofy-client/apps/goofy-e2e/cypress.json index 9f2c2906f690e5aaa2f3e3a29876591c95362c77..21c89d0c8470c0db693ceb66f0d0c5637e5b97bf 100644 --- a/goofy-client/apps/goofy-e2e/cypress.json +++ b/goofy-client/apps/goofy-e2e/cypress.json @@ -5,7 +5,8 @@ "database": "test", "keycloakRealm": "sh-e2e-dev", "keycloakUrl": "https://sso.dev.ozg-sh.de/", - "keycloakClient": "sh-e2e-dev-goofy" + "keycloakClient": "sh-e2e-dev-goofy", + "sabineUuid": "df385159-6055-4169-bb78-f5c6f60fe0cf" }, "fileServerFolder": ".", "fixturesFolder": "./src/fixtures", diff --git a/goofy-client/apps/goofy-e2e/src/integration/einheitlicher-ansprechpartner/vorgang-detail/vorgang-abschliessen.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/einheitlicher-ansprechpartner/vorgang-detail/vorgang-abschliessen.e2e-spec.ts index 1e86115a20a0b8784e8473fd8040074558316416..341e6387f6fe6db48d44f8f75258fe1a12dc277d 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/einheitlicher-ansprechpartner/vorgang-detail/vorgang-abschliessen.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/einheitlicher-ansprechpartner/vorgang-detail/vorgang-abschliessen.e2e-spec.ts @@ -41,7 +41,7 @@ describe('Vorgang abschliessen', () => { describe('by button', () => { it('should have status Beschieden', () => { - haveText(vorgangPage.getVorgangDetailHeader().getStatus(), "Fail Test"); + haveText(vorgangPage.getVorgangDetailHeader().getStatus(), vorgangStatusLabelE2E[vorgangAbschliessen.status]); }) it('should show snackBar message', () => { diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-detailansicht/vorgang-abschliessen.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-detailansicht/vorgang-abschliessen.e2e-spec.ts index 6f51d73f11ca438916ff28176835eae6a418a693..99cc32bc44fa0cbef0137a70ed07edffc5aaf00d 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-detailansicht/vorgang-abschliessen.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-detailansicht/vorgang-abschliessen.e2e-spec.ts @@ -41,7 +41,7 @@ describe('Vorgang abschliessen(EA)', () => { describe('by button', () => { it('should have status Beschieden', () => { - haveText(vorgangPage.getVorgangDetailHeader().getStatus(), "Fail Test"); + haveText(vorgangPage.getVorgangDetailHeader().getStatus(), vorgangStatusLabelE2E[vorgangAbschliessen.status]); }) it('should show snackBar message', () => {