fix: refs #8698 clean up Jenkinsfile and improve error handling in find.js
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2025-03-05 13:59:46 +01:00
parent 0f9f9bf21d
commit 838d5e24ce
2 changed files with 6 additions and 4 deletions

3
Jenkinsfile vendored
View File

@ -119,9 +119,6 @@ pipeline {
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
}
def modules = sh(script: 'node test/cypress/docker/find/find.js', returnStdout: true).trim()
echo env.GIT_COMMIT
echo env.GIT_PREVIOUS_COMMIT
echo env.GIT_BRANCH
if (modules == "") {
echo "No modules changed. Skipping execution"
return

View File

@ -10,9 +10,13 @@ function getGitDiff(options) {
}
async function getChangedModules() {
const CYPRESS_PATH = 'test/cypress/integration';
const FINDED_PATHS = ['src', CYPRESS_PATH];
let changedModules = new Set();
const changes = getGitDiff(process.argv);
for (const change of changes) {
if (!FINDED_PATHS.some((prefix) => change.startsWith(prefix)))
return CYPRESS_PATH + '/**/*.spec.js'; // all
changedModules = new Set([
...changedModules,
...new Set(getModules(await findImports(change))),
@ -23,6 +27,7 @@ async function getChangedModules() {
getChangedModules()
.then((modules) => console.log(modules)) // return
.catch(() => {
.catch((e) => {
console.error(e);
process.exit(1);
});