fix: refs #6695 try parallel
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
2fcc7c94b8
commit
6d7199b2ff
|
@ -183,20 +183,28 @@ def cleanDockerE2E() {
|
||||||
}
|
}
|
||||||
|
|
||||||
def runTestsInParallel() {
|
def runTestsInParallel() {
|
||||||
def integrationTests = sh(script: "ls -d test/cypress/integration/*/", returnStdout: true).trim().split('\n')
|
// 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/']
|
||||||
|
|
||||||
def tasks = [:]
|
def tasks = [:]
|
||||||
|
|
||||||
// Crear tareas para cada carpeta de tests
|
|
||||||
integrationTests.each { testFolder ->
|
integrationTests.each { testFolder ->
|
||||||
def folderName = testFolder.replaceAll('test/cypress/integration/', '').replaceAll('/', '')
|
if (testFolder.trim()) { // Evita procesar líneas vacías
|
||||||
tasks["e2e_${folderName}"] = {
|
def folderName = testFolder.replaceAll('test/cypress/integration/', '').replaceAll('/', '')
|
||||||
sh "docker-compose -p ${env.NETWORK}_${folderName} -f docker-compose.e2e.yml up -d back db"
|
folderName = folderName.replaceAll('[^a-zA-Z0-9_-]', '') // Seguridad en nombres de red
|
||||||
sh "docker-compose -p ${env.NETWORK}_${folderName} -f docker-compose.e2e.yml up -d front"
|
tasks["e2e_${folderName}"] = {
|
||||||
sh "docker-compose -p ${env.NETWORK}_${folderName} -f docker-compose.e2e.yml up e2e " +
|
sh """
|
||||||
"command=\"sh -c 'pnpm exec cypress install && pnpm exec cypress run --browser chromium --spec test/cypress/integration/${folderName}/**/*.spec.js'\""
|
docker-compose -p ${env.NETWORK}_${folderName} -f docker-compose.e2e.yml pull
|
||||||
|
docker-compose -p ${env.NETWORK}_${folderName} -f docker-compose.e2e.yml up -d back vn-database
|
||||||
|
docker-compose -p ${env.NETWORK}_${folderName} -f docker-compose.e2e.yml up -d front
|
||||||
|
docker-compose -p ${env.NETWORK}_${folderName} -f docker-compose.e2e.yml up e2e \
|
||||||
|
command="sh -c 'pnpm exec cypress install && pnpm exec cypress run --browser chromium --spec test/cypress/integration/${folderName}/**/*.spec.js'" \
|
||||||
|
--abort-on-container-exit
|
||||||
|
"""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parallel tasks
|
parallel tasks
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue