ci: refs #8698 try lastSuccessfulBuild
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2025-03-03 12:39:45 +01:00
parent d5486f89a5
commit ee96142f2d
2 changed files with 19 additions and 4 deletions

22
Jenkinsfile vendored
View File

@ -99,6 +99,7 @@ pipeline {
script: "git rev-parse HEAD",
returnStdout: true
).trim()
def files = []
while (lastSuccessfulBuild != null && lastSuccessfulBuild.result != 'SUCCESS') {
lastSuccessfulBuild = lastSuccessfulBuild.previousBuild
@ -129,7 +130,19 @@ pipeline {
modifiedFiles.each { file ->
echo "- ${file}"
if(!file.startsWith('src/pages')){
if(file.startsWith('test/cypress/integration')){
files.add(file)
}
//else {
// files = 'test/cypress/integration/**/*.spec.js'
// return
// }
}
files = (files + searchFiles(file)).unique()
}
echo "files: " + files
}
}
@ -228,7 +241,7 @@ pipeline {
}
}
def searchFiles = { searchString ->
def searchFiles = { searchString ->
def searchPath = "src/pages"
// Buscar en todos los archivos .vue dentro de src/pages
@ -240,6 +253,9 @@ pipeline {
// Filtrar por si la salida está vacía
matchingFiles = matchingFiles.findAll { it.trim() }
echo "Archivos donde se encontró '${searchString}': ${matchingFiles}"
return matchingFiles
// Extraer solo el tercer segmento del path
def extractedFolders = matchingFiles.collect { "test/cypress/integration/" + it.split("/")[2] + "/**/*.spec.js" }.unique()
echo "Carpetas donde se encontró '${searchString}': ${extractedFolders}"
return extractedFolders
}

View File

@ -51,7 +51,6 @@ async function onSubmit() {
});
}
}
// REMOVE:
</script>
<template>