Skip to content
Snippets Groups Projects
Commit b0a1fe48 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-3934 OZG-4395 adjust JenkinsFile - run Tests parrallel

parent 59e708b3
No related branches found
No related tags found
No related merge requests found
...@@ -190,19 +190,14 @@ pipeline { ...@@ -190,19 +190,14 @@ pipeline {
} }
} }
// stage('Pausing to wait for ozg-operator') { stage('Run E2E-Tests') {
// when {
// expression { !SKIP_RUN }
// }
// steps {
// sleep(time: 3, unit: 'MINUTES')
// }
// }
stage('Run E2E-EA Tests') {
when { when {
expression { !SKIP_RUN } expression { !SKIP_RUN }
} }
failFast false
parallel {
stage('E2E-EA') {
steps { steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
script { script {
...@@ -229,10 +224,7 @@ pipeline { ...@@ -229,10 +224,7 @@ pipeline {
} }
} }
stage('Run E2E-Main Tests') { stage('E2E-Main') {
when {
expression { !SKIP_RUN }
}
steps { steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
script { script {
...@@ -258,6 +250,8 @@ pipeline { ...@@ -258,6 +250,8 @@ pipeline {
} }
} }
} }
}
}
stage('Delete E2E Namespaces') { stage('Delete E2E Namespaces') {
when { when {
...@@ -611,18 +605,14 @@ Void publishE2ETestResult(String reportFolder, String reportName) { ...@@ -611,18 +605,14 @@ Void publishE2ETestResult(String reportFolder, String reportName) {
} }
String runTests(String bezeichner, String reportFolder, Integer dbPort, String stageName) { String runTests(String bezeichner, String reportFolder, Integer dbPort, String stageName) {
generateCypressConfig(bezeichner, reportFolder, dbPort) def config = generateCypressConfig(bezeichner, reportFolder, dbPort)
def specFolder = "apps/goofy-e2e/src/e2e/${reportFolder}" def specFolder = "apps/goofy-e2e/src/e2e/${reportFolder}"
try { try {
dir("goofy-client") { dir('goofy-client'){
sh "npx cypress version" sh "npm run cypress:version"
// sh "REPORT_FOLDER=${reportFolder} node apps/goofy-e2e/src/support/delete-old-reports.ts" sh "ls -al"
sh "NO_COLOR=1 npx cypress run --project apps/goofy-e2e --spec ${specFolder}" sh "npm run cypress:ci-run --CONFIG_FILE=${configFile} --REPORT_FOLDER=${reportFolder}"
// sh "test=$(echo $?)"
// sh "REPORT_FOLDER=${reportFolder} node apps/goofy-e2e/src/support/pre-merge.ts"
// sh "mochawesome-merge apps/goofy-e2e/reports/${npm_config_report_folder}/mochawesome-report/**/*.json > apps/goofy-e2e/reports/${npm_config_report_folder}/report.json"
// sh "marge apps/goofy-e2e/reports/${npm_config_report_folder}/report.json -f report -o apps/goofy-e2e/reports/${npm_config_report_folder}"
} }
} catch (Exception e) { } catch (Exception e) {
printNpmDebugLog() printNpmDebugLog()
...@@ -661,10 +651,10 @@ String cutBranchNameForKeycloakRealm(String branchName, String stageName) { ...@@ -661,10 +651,10 @@ String cutBranchNameForKeycloakRealm(String branchName, String stageName) {
String generateCypressConfig(String bezeichner, String testFolder, Integer dbPort) { String generateCypressConfig(String bezeichner, String testFolder, Integer dbPort) {
def namespace = generateNamespace(bezeichner) def namespace = generateNamespace(bezeichner)
def configName = "cypress.config.json" def configName = "cypress-ci-"+testFolder+".json"
dir('goofy-client/apps/goofy-e2e/'){ dir('goofy-client/apps/goofy-e2e/'){
def config = readJSON file: 'cypress.config.json' def config = readJSON file: 'cypress-ci.json'
def plutoDatabaseSecret = getPlutoDatabaseSecret(namespace); def plutoDatabaseSecret = getPlutoDatabaseSecret(namespace);
def decodedPassword = decodeString(plutoDatabaseSecret.password); def decodedPassword = decodeString(plutoDatabaseSecret.password);
...@@ -677,18 +667,23 @@ String generateCypressConfig(String bezeichner, String testFolder, Integer dbPor ...@@ -677,18 +667,23 @@ String generateCypressConfig(String bezeichner, String testFolder, Integer dbPor
config.env.keycloakRealm = namespace as String config.env.keycloakRealm = namespace as String
config.env.keycloakClient = "alfa" as String config.env.keycloakClient = "alfa" as String
config.env.sabineUuid = getKeycloakUuid(namespace, "sabine") as String config.env.sabineUuid = getKeycloakUuid(namespace, "sabine") as String
config.video = true config.video = false
config.videosFolder = "./reports/${testFolder}/videos" as String config.videosFolder = "./reports/${testFolder}/videos" as String
config.screenshotsFolder = "./reports/${testFolder}/screenshots" as String config.screenshotsFolder = "./reports/${testFolder}/screenshots" as String
config.reporterOptions.reportDir = "./reports/${testFolder}/mochawesome-report" as String config.reporterOptions.reportDir = "./reports/${testFolder}/mochawesome-report" as String
config.reporterOptions.quite = true config.reporterOptions.quite = true
config.reporterOptions.overwrite = false config.reporterOptions.overwrite = false
config.specPattern = 'src/e2e/**/*.cy.{js,jsx,ts,tsx}'
config.env.put("search", getElasticsearchEnv(namespace)) config.env.put("search", getElasticsearchEnv(namespace))
config.env.put("userManager", getUserManagerEnv(namespace, dbPort)) config.env.put("userManager", getUserManagerEnv(namespace, dbPort))
writeJSON file: configName, json: config writeJSON file: configName, json: config
sh "cat ${configName}"
} }
return "cypress-ci-"+testFolder+".config.ts"
} }
String makePasswordUrlConform(String password) { String makePasswordUrlConform(String password) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment