From bb678ea60ca71a025df798e437c34e13b4011ac9 Mon Sep 17 00:00:00 2001 From: Martin Porwoll Date: Mon, 15 Dec 2025 12:57:12 +0000 Subject: [PATCH] fix(ci): fix E2E tests - remove invalid NODE_OPTIONS flag and add PostgreSQL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove --no-experimental-strip-types from test:e2e as it's not allowed in NODE_OPTIONS - Add PostgreSQL service container for E2E tests - Add Payload migrations step before E2E tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 26 +++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2d97b4..19fb739 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -217,6 +217,20 @@ jobs: name: E2E Tests runs-on: ubuntu-latest needs: [build] + services: + postgres: + image: postgres:17 + env: + POSTGRES_USER: payload + POSTGRES_PASSWORD: payload_test_password + POSTGRES_DB: payload_test + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - name: Checkout code uses: actions/checkout@v4 @@ -244,12 +258,22 @@ jobs: - name: Install Playwright browsers run: pnpm exec playwright install chromium --with-deps + - name: Run Payload Migrations + run: pnpm payload migrate + env: + PAYLOAD_SECRET: e2e-secret-placeholder + DATABASE_URI: postgresql://payload:payload_test_password@localhost:5432/payload_test + NEXT_PUBLIC_SERVER_URL: http://localhost:3001 + PAYLOAD_PUBLIC_SERVER_URL: http://localhost:3001 + CONSENT_LOGGING_API_KEY: ci-consent-api-key-placeholder + IP_ANONYMIZATION_PEPPER: ci-anonymization-pepper-placeholder + - name: Run E2E tests run: pnpm test:e2e env: CI: true PAYLOAD_SECRET: e2e-secret-placeholder - DATABASE_URI: postgresql://placeholder:placeholder@localhost:5432/placeholder + DATABASE_URI: postgresql://payload:payload_test_password@localhost:5432/payload_test NEXT_PUBLIC_SERVER_URL: http://localhost:3001 PAYLOAD_PUBLIC_SERVER_URL: http://localhost:3001 EMAIL_DELIVERY_DISABLED: 'true' diff --git a/package.json b/package.json index a779535..2c4c927 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "test:security": "cross-env NODE_OPTIONS=--no-deprecation vitest run --config ./vitest.config.mts tests/unit/security tests/int/security-api.int.spec.ts", "test:access-control": "cross-env NODE_OPTIONS=--no-deprecation vitest run --config ./vitest.config.mts tests/unit/access-control", "test:coverage": "cross-env NODE_OPTIONS=--no-deprecation vitest run --config ./vitest.config.mts --coverage", - "test:e2e": "test -f .next/BUILD_ID || (echo 'Error: No build found. Run pnpm build first.' && exit 1) && cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" pnpm exec playwright test", + "test:e2e": "test -f .next/BUILD_ID || (echo 'Error: No build found. Run pnpm build first.' && exit 1) && cross-env NODE_OPTIONS=--no-deprecation pnpm exec playwright test", "prepare": "test -d .git && (ln -sf ../../scripts/detect-secrets.sh .git/hooks/pre-commit 2>/dev/null || true) || true" }, "dependencies": {