Skip to content

Commit

Permalink
fix: glob pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
fgnass committed Dec 24, 2024
1 parent 03e68e6 commit a29bffb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cypress/run.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ async function runCypress() {
args.push('--bail');
}

const specs = await globby(['cypress/e2e/*spec*.js']);

if (process.env.IS_FORK === 'true') {
const machineIndex = parseInt(process.env.MACHINE_INDEX);
const machineCount = parseInt(process.env.MACHINE_COUNT);
const specs = await globby(['cypress/integration/*spec*.js']);
const specsPerMachine = Math.floor(specs.length / machineCount);
const start = (machineIndex - 1) * specsPerMachine;
const machineSpecs =
Expand All @@ -20,7 +21,6 @@ async function runCypress() {
: specs.slice(start, start + specsPerMachine);

args.push('--spec', machineSpecs.join(','));
await execa('cypress', args, { stdio: 'inherit', preferLocal: true });
} else {
args.push(
'--record',
Expand All @@ -29,9 +29,12 @@ async function runCypress() {
process.env.GITHUB_SHA,
'--group',
'GitHub CI',
'--spec',
specs.join(','),
);
await execa('cypress', args, { stdio: 'inherit', preferLocal: true });
}

await execa('cypress', args, { stdio: 'inherit', preferLocal: true });
}

runCypress();

0 comments on commit a29bffb

Please sign in to comment.