Skip to content

Commit b324b2a

Browse files
mirqtioclaude
andcommitted
fix(ci): align environment variables with local .env.test for test parity
ROOT CAUSE: CI was executing 31 more tests than local (92 vs 81 per browser). Tests that should skip via test.skip() were running in CI due to missing environment variables that control feature flags and test behavior. SOLUTION: Add missing environment variables to playwright.config.ci.ts webServer env section to match local .env.test configuration exactly. Changes to playwright.config.ci.ts: - Added USE_MOCK_PURCHASE='true' (server-side mock control) - Added NEXT_PUBLIC_FF_PURCHASE_ENABLED='true' (purchase feature flag) - Added BYPASS_UTM_VALIDATION='false' (UTM redirect testing control) - Added NEXT_PUBLIC_ENABLE_TEST_HARNESS='true' (test utilities) - Added NEXT_PUBLIC_TEST_HARNESS_KEY='test-key-12345' (test auth) Expected Impact: - Test count per browser should drop from 98 to ~74 (matching local 81 executed) - Runtime test.skip() calls will now work correctly in CI - Tests skipped locally will also skip in CI (full parity) - Focus testing on the 81 tests that passed 100% in local baseline Local verification: - 111 tests declared across 17 spec files (matches expected after exclusions) - Same spec files as local baseline minus 5 excluded patterns - Environment variables now aligned for consistent test.skip() behavior Related: Commit 32a9e4b fixed testIgnore (spec-level exclusion) This commit fixes runtime skipping (test-level exclusion via test.skip()) Baseline: Local run 5438b418d431bae7 (81 passed, 37 skipped per browser) Documentation: See SCRATCHPAD.md for full investigation details 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 32a9e4b commit b324b2a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

playwright.config.ci.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ export default defineConfig({
161161
DISABLE_EMAIL: 'true',
162162
// Mock services
163163
NEXT_PUBLIC_USE_MOCK_PURCHASE: 'true',
164+
USE_MOCK_PURCHASE: 'true', // Server-side mock (aligns with .env.test)
165+
// Feature Flags (must match .env.test for test parity)
166+
NEXT_PUBLIC_FF_PURCHASE_ENABLED: 'true',
167+
BYPASS_UTM_VALIDATION: 'false',
168+
// Test Harness
169+
NEXT_PUBLIC_ENABLE_TEST_HARNESS: 'true',
170+
NEXT_PUBLIC_TEST_HARNESS_KEY: 'test-key-12345',
164171
// Config
165172
SKIP_ENV_VALIDATION: 'true',
166173
SENTRY_SUPPRESS_GLOBAL_ERROR_HANDLER_FILE_WARNING: '1',

0 commit comments

Comments
 (0)