From 2a1aef1c1b3a6bc0dca6ed03d0b8790258eeed7b Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 8 Sep 2026 16:47:39 +0200 Subject: [PATCH] fix: complete Playwright removal in CI deploy workflow Drop the leftover Playwright browser install and e2e smoke test from the deployment script, and update the deployment contract tests to cover the verify-deployed-release smoke check instead. --- .dockerignore | 3 --- scripts/ci-deploy.sh | 5 +---- src/lib/ci-deploy.test.ts | 2 +- src/lib/ci-workflow-contract.test.ts | 5 +++-- src/lib/deploy-workflow-contract.test.ts | 2 +- src/test/ci-deploy-harness.sh | 10 ++++++++-- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.dockerignore b/.dockerignore index 265d8fd4..0e0ef78b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -34,8 +34,5 @@ public/cache public/tmp db_backup_*.sql *.log -playwright-report -test-results -blob-report .codex .agents diff --git a/scripts/ci-deploy.sh b/scripts/ci-deploy.sh index 0f926123..c5b9753e 100644 --- a/scripts/ci-deploy.sh +++ b/scripts/ci-deploy.sh @@ -93,8 +93,6 @@ for managed_name in epicnext-cms epicnext-cms-app; do done cp "$deploy_dir/.env" .env pnpm install --frozen-lockfile -# Prepare browser before cutover so installation failures cannot interrupt the site. -pnpm exec playwright install chromium echo "Building $image" DOCKER_BUILDKIT=1 docker build --network=host --progress=plain --cache-from epicnext-cms:latest \ @@ -161,8 +159,7 @@ candidate_attempted=1 ) healthy node scripts/verify-deployed-release.mjs http://127.0.0.1:3002/api/health "$sha" -PLAYWRIGHT_BASE_URL=http://127.0.0.1:3002 pnpm test:e2e -# Publish the latest alias only after health and browser checks pass. +# Publish the latest alias only after health and release checks pass. docker tag "$image" epicnext-cms:latest cutover_started=0 if [ "$backup_created" -eq 1 ]; then docker rm "$backup_name" || true; fi diff --git a/src/lib/ci-deploy.test.ts b/src/lib/ci-deploy.test.ts index 60ee35f2..8339ea3e 100644 --- a/src/lib/ci-deploy.test.ts +++ b/src/lib/ci-deploy.test.ts @@ -77,7 +77,7 @@ describe("deployment transaction", () => { expect(result.calls.indexOf("pnpm db:migrate")).toBeLessThan( result.calls.indexOf("docker stop"), ); - expect(result.calls.indexOf("pnpm test:e2e")).toBeLessThan( + expect(result.calls.indexOf("verify-deployed-release.mjs")).toBeLessThan( result.calls.indexOf( `docker tag epicnext-cms:${sha} epicnext-cms:latest`, ), diff --git a/src/lib/ci-workflow-contract.test.ts b/src/lib/ci-workflow-contract.test.ts index 6d000c9f..750cfb39 100644 --- a/src/lib/ci-workflow-contract.test.ts +++ b/src/lib/ci-workflow-contract.test.ts @@ -61,7 +61,8 @@ describe("CI workflow", () => { it("smoke-tests the deployed app within the deployment transaction", () => { expect(workflow).toContain("bash scripts/ci-deploy.sh"); const deploy = readFileSync("scripts/ci-deploy.sh", "utf8"); - expect(deploy).toContain("pnpm test:e2e"); - expect(deploy).toContain("PLAYWRIGHT_BASE_URL"); + expect(deploy).toContain( + "node scripts/verify-deployed-release.mjs http://127.0.0.1:3002/api/health", + ); }); }); diff --git a/src/lib/deploy-workflow-contract.test.ts b/src/lib/deploy-workflow-contract.test.ts index b459136b..cf76594d 100644 --- a/src/lib/deploy-workflow-contract.test.ts +++ b/src/lib/deploy-workflow-contract.test.ts @@ -8,7 +8,7 @@ it("uses two test workers and runs smoke checks in the deployment transaction", expect(workflow).not.toContain("\n e2e:"); expect(workflow).toContain("bash scripts/ci-deploy.sh"); expect(deploy).toContain( - "PLAYWRIGHT_BASE_URL=http://127.0.0.1:3002 pnpm test:e2e", + "node scripts/verify-deployed-release.mjs http://127.0.0.1:3002/api/health", ); }); it("locks CI and scheduled deployments using the same production lock", () => { diff --git a/src/test/ci-deploy-harness.sh b/src/test/ci-deploy-harness.sh index 61bdaae5..3ec66ee0 100644 --- a/src/test/ci-deploy-harness.sh +++ b/src/test/ci-deploy-harness.sh @@ -13,7 +13,6 @@ flock() { echo "lock" >> "$TEST_DIR/calls"; [ "$SCENARIO" != lock-failure ]; } pnpm() { echo "pnpm $*" >> "$TEST_DIR/calls" if [ "$1" = db:migrate ] && [ "$SCENARIO" = migration-failure ]; then return 1; fi - if [ "$1" = test:e2e ] && [ "$SCENARIO" = smoke-failure ]; then return 1; fi return 0 } curl() { @@ -43,5 +42,12 @@ docker() { } export -f git flock pnpm curl sleep docker -node() { echo "node $*" >> "$TEST_DIR/calls"; [ "$SCENARIO" != release-failure ]; } +node() { + echo "node $*" >> "$TEST_DIR/calls" + case "$SCENARIO" in + release-failure) return 1 ;; + smoke-failure) case "$*" in *verify-deployed-release.mjs*) return 1 ;; esac ;; + esac + return 0 +} export -f node