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
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
0f9f9bf21d
commit
838d5e24ce
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue