fix: refs #6695 update E2E stages to run tests in parallel for specific folders
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2025-02-11 15:41:19 +01:00
parent 7cd6716308
commit 68210f817d
1 changed files with 22 additions and 6 deletions

28
Jenkinsfile vendored
View File

@ -107,10 +107,25 @@ pipeline {
}
}
stage('Run E2E') {
stage('E2E: Basic') {
steps {
script {
runTestsInParallel()
runTestsInParallel([
'test/cypress/integration/vnComponent/',
'test/cypress/integration/outLogin/',
])
}
}
}
stage('E2E: Sections') {
steps {
script {
runTestsInParallel([
'test/cypress/integration/claim/',
'test/cypress/integration/client/',
'test/cypress/integration/entry/',
'test/cypress/integration/invoiceIn/'
])
}
}
@ -190,12 +205,13 @@ def cleanDockerE2E() {
}
}
def runTestsInParallel() {
// def integrationTests = sh(script: "ls -d test/cypress/integration/*/ || echo ''", returnStdout: true).trim().split('\n')
def integrationTests = ['test/cypress/integration/claim/', 'test/cypress/integration/client/', 'test/cypress/integration/entry/', 'test/cypress/integration/invoiceIn/']
def runTestsInParallel(List<String> folders) {
if (!folders) { // Si es null o vacío, asigna valores por defecto
folders =sh(script: "ls -d test/cypress/integration/*/ || echo ''", returnStdout: true).trim().split('\n')
}
def tasks = [:]
integrationTests.each { testFolder ->
folders.each { testFolder ->
if (testFolder.trim()) {
def folderName = testFolder.replaceAll('test/cypress/integration/', '').replaceAll('/', '')
folderName = folderName.replaceAll('[^a-zA-Z0-9_-]', '') // Seguridad en nombres de red