test: refs #6695 run all e2e
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
1da88fd70c
commit
d0ba2f41e1
|
@ -105,11 +105,6 @@ pipeline {
|
||||||
sh 'git clone https://gitea.verdnatura.es/verdnatura/salix.git'
|
sh 'git clone https://gitea.verdnatura.es/verdnatura/salix.git'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build E2E') {
|
|
||||||
steps {
|
|
||||||
sh 'docker-compose -f docker-compose.e2e.yml build e2e'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Up') {
|
stage('Up') {
|
||||||
parallel{
|
parallel{
|
||||||
stage('Database') {
|
stage('Database') {
|
||||||
|
@ -129,32 +124,27 @@ pipeline {
|
||||||
sh 'docker-compose -f docker-compose.e2e.yml up -d --build front'
|
sh 'docker-compose -f docker-compose.e2e.yml up -d --build front'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
stage('Build Cypress') {
|
||||||
}
|
|
||||||
stage('Run: Globals') {
|
|
||||||
parallel{
|
|
||||||
stage('outLogin') {
|
|
||||||
steps {
|
steps {
|
||||||
sh 'docker-compose -f docker-compose.e2e.yml run e2e npx cypress run --config specPattern=test/cypress/integration/outLogin/**/*.spec.js'
|
sh 'docker-compose -f docker-compose.e2e.yml build e2e'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('vnComponent') {
|
}
|
||||||
|
}
|
||||||
|
stage('Run E2E') {
|
||||||
steps {
|
steps {
|
||||||
sh 'docker-compose -f docker-compose.e2e.yml run e2e npx cypress run --config specPattern=test/cypress/integration/vnComponent/**/*.spec.js'
|
script {
|
||||||
|
sh 'docker-compose -f docker-compose.e2e.yml up e2e'
|
||||||
|
def containerId = sh(script: "docker-compose -f docker-compose.e2e.yml ps -q e2e", returnStdout: true).trim()
|
||||||
|
if (containerId) {
|
||||||
|
def exitCode = sh(script: "docker inspect -f '{{.State.ExitCode}}' ${containerId}", returnStdout: true).trim()
|
||||||
|
sh "docker cp ${containerId}:/app/test/cypress/reports ./test/cypress/"
|
||||||
|
if (exitCode != '0') {
|
||||||
|
def logs = sh(script: "docker logs ${containerId}", returnStdout: true).trim()
|
||||||
|
error("Cypress E2E tests failed with exit code: ${exitCode}\nLogs:\n${logs}")
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
}
|
error("The Docker container for E2E tests could not be created")
|
||||||
}
|
|
||||||
stage('Run: Specifics') {
|
|
||||||
parallel{
|
|
||||||
stage('claim') {
|
|
||||||
steps {
|
|
||||||
sh 'docker-compose -f docker-compose.e2e.yml run e2e npx cypress run --config specPattern=test/cypress/integration/claim/**/*.spec.js'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('item') {
|
|
||||||
steps {
|
|
||||||
sh 'docker-compose -f docker-compose.e2e.yml run e2e npx cypress run --config specPattern=test/cypress/integration/item/**/*.spec.js'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,17 +152,6 @@ pipeline {
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
// def containerId = sh(script: "docker-compose -f docker-compose.e2e.yml ps -q e2e", returnStdout: true).trim()
|
|
||||||
// if (containerId) {
|
|
||||||
// def exitCode = sh(script: "docker inspect -f '{{.State.ExitCode}}' ${containerId}", returnStdout: true).trim()
|
|
||||||
// sh "docker cp ${containerId}:/app/test/cypress/reports ./test/cypress/"
|
|
||||||
// if (exitCode != '0') {
|
|
||||||
// def logs = sh(script: "docker logs ${containerId}", returnStdout: true).trim()
|
|
||||||
// error("Cypress E2E tests failed with exit code: ${exitCode}\nLogs:\n${logs}")
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// error("The Docker container for E2E tests could not be created")
|
|
||||||
// }
|
|
||||||
cleanDockerE2E()
|
cleanDockerE2E()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -221,21 +200,3 @@ def cleanDockerE2E() {
|
||||||
sh 'docker-compose -f docker-compose.e2e.yml down || true'
|
sh 'docker-compose -f docker-compose.e2e.yml down || true'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def runCypressTests(folders) {
|
|
||||||
script {
|
|
||||||
def parallelStages = [:]
|
|
||||||
folders.each { folder ->
|
|
||||||
parallelStages["E2E - ${folder}"] = {
|
|
||||||
stage("E2E - ${folder}") {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
sh "docker-compose run e2e npx cypress run --config specPattern=test/cypress/integration/${folder}/**/*.spec.js"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
parallel parallelStages
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue