Skip to content

Commit 2e2a04a

Browse files
committed
fix(cypress): clarify manual sharding for forks in runCypress function
1 parent c06350c commit 2e2a04a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cypress/run.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ async function runCypress() {
1212

1313
const machineIndex = Number(process.env.MACHINE_INDEX || 0);
1414
const machineCount = Number(process.env.MACHINE_COUNT || 0);
15+
const isFork = process.env.IS_FORK === 'true';
1516

16-
if (machineIndex && machineCount) {
17+
if (isFork && machineIndex && machineCount) {
1718
const specsPerMachine = Math.floor(specs.length / machineCount);
1819
const start = (machineIndex - 1) * specsPerMachine;
1920
const machineSpecs =
@@ -22,7 +23,7 @@ async function runCypress() {
2223
: specs.slice(start, start + specsPerMachine);
2324

2425
console.log(
25-
`Sharding specs manually: machine ${machineIndex}/${machineCount} running ${machineSpecs.length} specs`,
26+
`Sharding specs manually for fork: machine ${machineIndex}/${machineCount} running ${machineSpecs.length} specs`,
2627
);
2728
args.push('--spec', machineSpecs.join(','));
2829
} else {

0 commit comments

Comments
 (0)