Skip to content

Commit 1f5b905

Browse files
committed
ci(e2e): add vercel protection bypass for integration tests
Configure Playwright integration tests to bypass Vercel's deployment protection using the x-vercel-protection-bypass header. This enables automated tests to access protected Vercel deployments without manual intervention. Changes include: - Add extraHTTPHeaders to Playwright config with bypass secret - Whitelist VERCEL_AUTOMATION_BYPASS_SECRET in turbo.json for all integration test tasks - Pass bypass secret from GitHub secrets in CI workflow
1 parent d726bba commit 1f5b905

File tree

5 files changed

+18
-2
lines changed

5 files changed

+18
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ jobs:
492492
CLERK_USE_RQ: ${{ matrix.clerk-use-rq }}
493493
INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }}
494494
NODE_EXTRA_CA_CERTS: ${{ github.workspace }}/integration/certs/rootCA.pem
495+
VERCEL_AUTOMATION_BYPASS_SECRET: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}
495496

496497
- name: Upload test-results
497498
if: ${{ cancelled() || failure() }}

integration/tests/next-quickstart-keyless.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ const mockClaimedInstanceEnvironmentCall = async (page: Page) => {
2424

2525
test.describe('Keyless mode @quickstart', () => {
2626
test.describe.configure({ mode: 'serial' });
27+
28+
test.use({
29+
extraHTTPHeaders: {
30+
'x-vercel-protection-bypass': process.env.VERCEL_AUTOMATION_BYPASS_SECRET || '',
31+
},
32+
});
33+
2734
let app: Application;
2835
let dashboardUrl = 'https://dashboard.clerk.com/';
2936

integration/tests/react-router/library-mode.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { createTestUtils } from '../../testUtils';
77

88
test.describe('Library Mode basic tests for @react-router', () => {
99
test.describe.configure({ mode: 'parallel' });
10+
1011
let app: Application;
1112
let fakeUser: FakeUser;
1213
let fakeOrganization: FakeOrganization;

integration/tests/react-router/pre-middleware.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { createTestUtils } from '../../testUtils';
77

88
test.describe('basic tests for @react-router without middleware', () => {
99
test.describe.configure({ mode: 'parallel' });
10+
1011
let app: Application;
1112
let fakeUser: FakeUser;
1213

turbo.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@
3131
"VERCEL",
3232
"VITE_CLERK_*"
3333
],
34-
"globalPassThroughEnv": ["AWS_SECRET_KEY", "GITHUB_TOKEN", "ACTIONS_RUNNER_DEBUG", "ACTIONS_STEP_DEBUG"],
34+
"globalPassThroughEnv": [
35+
"AWS_SECRET_KEY",
36+
"GITHUB_TOKEN",
37+
"ACTIONS_RUNNER_DEBUG",
38+
"ACTIONS_STEP_DEBUG",
39+
"VERCEL_AUTOMATION_BYPASS_SECRET"
40+
],
3541
"tasks": {
3642
"build": {
3743
"dependsOn": ["^build"],
@@ -218,7 +224,7 @@
218224
"outputLogs": "new-only"
219225
},
220226
"//#test:integration:quickstart": {
221-
"env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"],
227+
"env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS", "VERCEL_AUTOMATION_BYPASS_SECRET"],
222228
"inputs": ["integration/**"],
223229
"outputLogs": "new-only"
224230
},

0 commit comments

Comments
 (0)