diff --git a/alfa-client/Jenkinsfile.e2e b/alfa-client/Jenkinsfile.e2e index 2bcce4b2596ccf046841b61d1469d01ea096ab30..2141e33a21aceb3ec54546c237f38d71de9ff7ee 100644 --- a/alfa-client/Jenkinsfile.e2e +++ b/alfa-client/Jenkinsfile.e2e @@ -205,11 +205,20 @@ pipeline { checkoutGitopsE2eBranch() + deleteNamespaces([env.EA_BEZEICHNER, env.MAIN_BEZEICHNER, env.ADMIN_BEZEICHNER]) + generateNamespaces() pushGitopsRepo() } } + post { + failure { + script { + deleteNamespaces([env.EA_BEZEICHNER, env.MAIN_BEZEICHNER, env.ADMIN_BEZEICHNER]) + } + } + } } stage("Install Cypress") { @@ -239,7 +248,15 @@ pipeline { script { FAILED_STAGE = env.STAGE_NAME - waitForAlfaRollout([env.MAIN_BEZEICHNER]) + waitForAdminRollout(env.ADMIN_BEZEICHNER) + waitForAlfaRollout([env.EA_BEZEICHNER, env.MAIN_BEZEICHNER]) + } + } + post { + failure { + script { + deleteNamespaces([env.EA_BEZEICHNER, env.MAIN_BEZEICHNER, env.ADMIN_BEZEICHNER]) + } } } } @@ -264,7 +281,36 @@ pipeline { // failFast false // parallel { + stage('E2E-Alfa-EA') { + when { + expression { !SKIP_RUN } + } + steps { + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + script { + def bezeichner = env.EA_BEZEICHNER + Integer mongoDbPort = forwardMongoDbPort(generateNamespace(bezeichner)) + + runTests(bezeichner, 'alfa-e2e', 'einheitlicher-ansprechpartner', env.KEYCLOAK_CLIENT_ALFA_APP, mongoDbPort, env.STAGE_NAME) + + stopForwardMongoDbPort(generateNamespace(bezeichner)) + } + } + } + post { + failure { + script { + FAILED_PARALLEL_STAGE += "${env.STAGE_NAME} " + } + } + always { + script { + publishAlfaE2ETestResult("einheitlicher-ansprechpartner", "Alfa E2E-Tests EA") + } + } + } + } stage('E2E-Alfa-Main') { when { @@ -296,9 +342,52 @@ pipeline { } } } + stage('E2E-Admin-Main') { + when { + expression { !SKIP_RUN } + } + steps { + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + script { + String bezeichner = env.ADMIN_BEZEICHNER + + Integer mongoDbPort = forwardMongoDbPort(generateNamespace(bezeichner)) + + runTests(bezeichner, 'admin-e2e', 'main-tests', env.KEYCLOAK_CLIENT_ADMIN_APP, mongoDbPort, env.STAGE_NAME) + + stopForwardMongoDbPort(generateNamespace(bezeichner)) + } + } + } + post { + failure { + script { + FAILED_PARALLEL_STAGE += "${env.STAGE_NAME} " + } + } + always { + script { + publishAdminE2ETestResult() + } + } + } + } // } //} + stage('Delete E2E Namespaces') { + when { + expression { !SKIP_RUN } + } + steps { + script { + FAILED_STAGE = env.STAGE_NAME + + deleteNamespaces([env.EA_BEZEICHNER, env.MAIN_BEZEICHNER, env.ADMIN_BEZEICHNER]) + } + } + } + } post { failure { @@ -454,10 +543,12 @@ Void checkoutGitopsE2eBranch() { } Void generateNamespaces() { + def y1 = generateAdminNamespaceYaml() + def y2 = generateEaNamespaceYaml() def y3 = generateMainNamespaceYaml() dir("gitops") { - sh "git add ${y3}" + sh "git add ${y1} ${y2} ${y3}" sh "git commit -m 'add e2e namespaces for testrun'" } diff --git a/alfa-client/apps/run-tests.sh b/alfa-client/apps/run-tests.sh index fa2fea18f97db17f502fc47e49e2852100a8f40a..c356946270ce2c89537f755300ba4d846eb663ec 100755 --- a/alfa-client/apps/run-tests.sh +++ b/alfa-client/apps/run-tests.sh @@ -40,7 +40,7 @@ if [ -z $CONFIG_FILE ]; then echo "Config File not set" && exit 1; fi SCRIPT_DIR="$(dirname "$0")" BASE_PATH=${SCRIPT_DIR}/${APP_NAME} -SPEC_GROUP=${BASE_PATH}/src/e2e/main-tests/vorgang-bescheid/vorgang-bescheid-dokumente-hochladen.cy.ts +SPEC_GROUP=${BASE_PATH}/src/e2e/${APP_VARIATION} COMMAND="pnpm exec cypress run --project ${BASE_PATH} --spec ${SPEC_GROUP} --config-file ${CONFIG_FILE}" REPORT_PATH=${BASE_PATH}/reports/${APP_VARIATION}