diff --git a/scripts/test-runner.js b/scripts/test-runner.js index a844c6c897..0ed39de11b 100644 --- a/scripts/test-runner.js +++ b/scripts/test-runner.js @@ -12,7 +12,7 @@ const FTEST = path.join(__dirname, '../ftest'); function runFunctionalTests(project, dir) { if (!fs.existsSync(dir)) { console.warn(`The directory "${dir}" doesn't exist, no tests will run for "${project}".`); - return false; + return; } console.info(`Starting Functional Tests for "${project}" on "${dir}" location.`); const ftestArgs = [...process.argv, '--cucumberReport', path.join(FTEST, 'target/cucumber-reports')]; @@ -21,7 +21,6 @@ function runFunctionalTests(project, dir) { console.error(`An error was returned by the process running the Functional Tests for "${project}".`); process.exit(run.status); } - return true; } if (fs.existsSync(path.join(FTEST, 'target/cucumber-reports')) && process.env.CUCUMBER_REPORT_PATH) { @@ -29,22 +28,9 @@ if (fs.existsSync(path.join(FTEST, 'target/cucumber-reports')) && process.env.CU } if (!args.skipWebUi) { - if (!runFunctionalTests('WebUI', FTEST)) { - process.exit(1); - } + runFunctionalTests('WebUI', FTEST); } - -const addons = (process.env.NUXEO_PACKAGES || '') +(process.env.NUXEO_PACKAGES || '') .split(/[\s,]+/) - .filter(Boolean); - -let hasFailed = false; - -addons.forEach((addon) => { - if (hasFailed) return; - const addonDir = path.join(__dirname, `../addons/${addon}/ftest`); - if (!runFunctionalTests(addon, addonDir)) { - hasFailed = true; - process.exit(1); - } -}); + .filter(Boolean) + .forEach((addon) => runFunctionalTests(addon, path.join(__dirname, `../addons/${addon}/ftest`)));