test: refs #6695 capture 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
1ca6fd15b5
commit
3a14c76ad0
|
@ -93,18 +93,16 @@ pipeline {
|
||||||
NODE_ENV = ""
|
NODE_ENV = ""
|
||||||
CREDENTIALS = credentials('docker-registry')
|
CREDENTIALS = credentials('docker-registry')
|
||||||
}
|
}
|
||||||
stages {
|
steps {
|
||||||
stage('Setup') {
|
script {
|
||||||
steps {
|
def packageJson = readJSON file: 'package.json'
|
||||||
script {
|
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||||
def packageJson = readJSON file: 'package.json'
|
cleanDockerE2E()
|
||||||
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
|
||||||
cleanDockerE2E()
|
|
||||||
}
|
|
||||||
sh 'rm -rf salix'
|
|
||||||
sh 'git clone https://gitea.verdnatura.es/verdnatura/salix.git'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
sh 'rm -rf salix'
|
||||||
|
sh 'git clone https://gitea.verdnatura.es/verdnatura/salix.git'
|
||||||
|
}
|
||||||
|
stages {
|
||||||
stage('Up') {
|
stage('Up') {
|
||||||
parallel{
|
parallel{
|
||||||
stage('Database') {
|
stage('Database') {
|
||||||
|
@ -127,17 +125,28 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('Run E2E') {
|
stage('Run E2E') {
|
||||||
steps {
|
steps {
|
||||||
sh 'docker-compose -f docker-compose.e2e.yml up e2e'
|
script {
|
||||||
|
sh 'docker-compose -f docker-compose.e2e.yml up e2e'
|
||||||
|
def result = sh(script: 'docker-compose -f docker-compose.e2e.yml ps -q e2e | xargs docker inspect -f "{{.State.ExitCode}}"', returnStatus: true)
|
||||||
|
sh 'docker cp $(docker-compose -f docker-compose.e2e.yml ps -q e2e):/app/test/cypress/reports ./test/cypress/'
|
||||||
|
if (result != 0) {
|
||||||
|
error("Cypress E2E tests failed with exit code: ${result}")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
|
publishHTML([
|
||||||
|
allowMissing: true,
|
||||||
|
alwaysLinkToLastBuild: true,
|
||||||
|
keepAll: true,
|
||||||
|
reportDir: 'test/cypress/reports',
|
||||||
|
reportFiles: '*.html',
|
||||||
|
reportName: 'Cypress Mochawesome Report'
|
||||||
|
])
|
||||||
cleanDockerE2E()
|
cleanDockerE2E()
|
||||||
junit(
|
|
||||||
testResults: 'junitresults.xml',
|
|
||||||
allowEmptyResults: true
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ export default defineConfig({
|
||||||
embeddedScreenshots: true,
|
embeddedScreenshots: true,
|
||||||
reportDir: 'test/cypress/reports',
|
reportDir: 'test/cypress/reports',
|
||||||
inlineAssets: true,
|
inlineAssets: true,
|
||||||
|
json: true,
|
||||||
},
|
},
|
||||||
component: {
|
component: {
|
||||||
componentFolder: 'src',
|
componentFolder: 'src',
|
||||||
|
@ -33,7 +34,6 @@ export default defineConfig({
|
||||||
setupNodeEvents: async (on, config) => {
|
setupNodeEvents: async (on, config) => {
|
||||||
const plugin = await import('cypress-mochawesome-reporter/plugin');
|
const plugin = await import('cypress-mochawesome-reporter/plugin');
|
||||||
plugin.default(on);
|
plugin.default(on);
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
viewportWidth: 1280,
|
viewportWidth: 1280,
|
||||||
|
|
|
@ -7,7 +7,7 @@ services:
|
||||||
dockerfile: ./Dockerfile.e2e
|
dockerfile: ./Dockerfile.e2e
|
||||||
network_mode: host
|
network_mode: host
|
||||||
e2e:
|
e2e:
|
||||||
command: npx cypress run --reporter junit --reporter-options "mochaFile=junitresults.xml"
|
command: npx cypress run
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./Dockerfile.e2e
|
dockerfile: ./Dockerfile.e2e
|
||||||
|
|
Loading…
Reference in New Issue