fix(cypress): refs #8698 improve parallel test execution and adjust module detection logic
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
22a978098e
commit
76e9aab5ae
|
@ -1,13 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo $2
|
||||
if [ -z "$2" ]; then
|
||||
TEST_DIRS=$(find 'test/cypress/integration' -mindepth 1 -maxdepth 1 -type d)
|
||||
else
|
||||
TEST_DIRS=$2
|
||||
fi
|
||||
|
||||
# Ejecutar Cypress en paralelo
|
||||
# echo $TEST_DIRS x$1
|
||||
echo $TEST_DIRS x$1
|
||||
|
||||
echo "$TEST_DIRS" | xargs -P "$1" -I {} sh -c '
|
||||
echo "🔷 {}" &&
|
||||
|
|
|
@ -10,13 +10,11 @@ function getGitDiff(options) {
|
|||
}
|
||||
|
||||
async function getChangedModules() {
|
||||
const CYPRESS_PATH = 'test/cypress/integration';
|
||||
const FINDED_PATHS = ['src', CYPRESS_PATH];
|
||||
const FINDED_PATHS = ['src', 'test/cypress/integration'];
|
||||
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
|
||||
if (!FINDED_PATHS.some((prefix) => change.startsWith(prefix))) return '';
|
||||
changedModules = new Set([
|
||||
...changedModules,
|
||||
...new Set(getModules(await findImports(change))),
|
||||
|
|
Loading…
Reference in New Issue