Skip to content

Commit c8de0ad

Browse files
fix(cypress): clarify manual sharding for forks in runCypress function (#7743)
1 parent beb94a3 commit c8de0ad

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
if: ${{ needs.changes.outputs.cms == 'true' }}
6161
runs-on: ubuntu-latest
6262
strategy:
63-
fail-fast: false # Let Cypress Cloud auto-cancellation handle failures
63+
fail-fast: true
6464
matrix:
6565
machine: [1, 2, 3, 4]
6666
steps:

cypress/run.mjs

Lines changed: 3 additions & 5 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 {
@@ -51,9 +52,6 @@ async function runCypress() {
5152
if (tags.length > 0) {
5253
args.push('--tag', tags.join(','));
5354
}
54-
55-
// Enable auto-cancellation to save CI time on failures
56-
args.push('--auto-cancel-after-failures', '3');
5755
}
5856

5957
console.log('Running Cypress with args:', args.join(' '));

0 commit comments

Comments
 (0)