Skip to content

Commit 91e815f

Browse files
Merge branch 'main' into fix-cypress-fork
2 parents 2e2a04a + beb94a3 commit 91e815f

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

.github/workflows/nodejs.yml

Lines changed: 3 additions & 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: true
63+
fail-fast: false # Let Cypress Cloud auto-cancellation handle failures
6464
matrix:
6565
machine: [1, 2, 3, 4]
6666
steps:
@@ -99,6 +99,8 @@ jobs:
9999
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
100100
NODE_OPTIONS: --max-old-space-size=4096
101101
TZ: Europe/Amsterdam
102+
GITHUB_EVENT_NAME: ${{ github.event_name }}
103+
GITHUB_BASE_REF: ${{ github.base_ref }}
102104
- uses: actions/upload-artifact@v4
103105
if: failure()
104106
with:

cypress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineConfig } from 'cypress';
33
export default defineConfig({
44
projectId: '1c35bs',
55
retries: {
6-
runMode: 4,
6+
runMode: 2, // Reduced from 4 - Cypress Cloud helps identify flaky tests
77
openMode: 0,
88
},
99
e2e: {

cypress/run.mjs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,32 @@ async function runCypress() {
2929
} else {
3030
const ciBuildId =
3131
process.env.CI_BUILD_ID || process.env.GITHUB_RUN_ID || process.env.GITHUB_SHA;
32-
32+
33+
// Determine group name based on context
34+
const isPR = process.env.GITHUB_EVENT_NAME === 'pull_request';
35+
const groupName = isPR ? 'PR Checks' : 'GitHub CI';
36+
37+
// Add tags for better organization in Cypress Cloud
38+
const tags = [];
39+
if (isPR) tags.push('pr');
40+
if (process.env.GITHUB_BASE_REF) tags.push(`base:${process.env.GITHUB_BASE_REF}`);
41+
3342
args.push(
3443
'--record',
3544
'--parallel',
3645
'--ci-build-id',
3746
ciBuildId,
3847
'--group',
39-
'GitHub CI',
40-
'--spec',
41-
specs.join(','),
48+
groupName,
4249
);
50+
51+
// Add tags if present
52+
if (tags.length > 0) {
53+
args.push('--tag', tags.join(','));
54+
}
55+
56+
// Enable auto-cancellation to save CI time on failures
57+
args.push('--auto-cancel-after-failures', '3');
4358
}
4459

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

0 commit comments

Comments
 (0)