test: refs #6695 try handle e2e erros and publish
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
db6783e9d4
commit
040673f500
|
@ -94,7 +94,7 @@ pipeline {
|
||||||
CREDENTIALS = credentials('docker-registry')
|
CREDENTIALS = credentials('docker-registry')
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Steup') {
|
stage('Setup') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def packageJson = readJSON file: 'package.json'
|
def packageJson = readJSON file: 'package.json'
|
||||||
|
@ -129,21 +129,15 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
sh 'docker-compose -f docker-compose.e2e.yml up e2e'
|
sh 'docker-compose -f docker-compose.e2e.yml up e2e'
|
||||||
// Obtener el ID del contenedor e2e
|
|
||||||
def containerId = sh(script: "docker-compose -f docker-compose.e2e.yml ps -q e2e", returnStdout: true).trim()
|
def containerId = sh(script: "docker-compose -f docker-compose.e2e.yml ps -q e2e", returnStdout: true).trim()
|
||||||
if (containerId) {
|
if (containerId) {
|
||||||
// Obtener el exit code del contenedor
|
|
||||||
def exitCode = sh(script: "docker inspect -f '{{.State.ExitCode}}' ${containerId}", returnStdout: true).trim()
|
def exitCode = sh(script: "docker inspect -f '{{.State.ExitCode}}' ${containerId}", returnStdout: true).trim()
|
||||||
|
|
||||||
// Copiar reportes desde el contenedor a Jenkins
|
|
||||||
sh "docker cp ${containerId}:/app/test/cypress/reports ./test/cypress/"
|
sh "docker cp ${containerId}:/app/test/cypress/reports ./test/cypress/"
|
||||||
|
|
||||||
// Si hubo errores en Cypress, fallar el build
|
|
||||||
if (exitCode != '0') {
|
if (exitCode != '0') {
|
||||||
error("Cypress E2E tests failed with exit code: ${exitCode}")
|
error("Cypress E2E tests failed with exit code: ${exitCode}")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
error("No se encontró el contenedor e2e.")
|
error("The Docker container for E2E tests could not be created")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -151,15 +145,6 @@ pipeline {
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
// sh 'docker cp $(docker-compose -f docker-compose.e2e.yml ps -q e2e):/app/test/cypress/reports ./test/cypress/' // in run
|
|
||||||
// publishHTML([
|
|
||||||
// allowMissing: true,
|
|
||||||
// alwaysLinkToLastBuild: true,
|
|
||||||
// keepAll: true,
|
|
||||||
// reportDir: 'test/cypress/reports',
|
|
||||||
// reportFiles: '*.html',
|
|
||||||
// reportName: 'Cypress Mochawesome Report'
|
|
||||||
// ])
|
|
||||||
cleanDockerE2E()
|
cleanDockerE2E()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue