From ecfb2029ceac550d886eac206ce5ea71fe6f338f Mon Sep 17 00:00:00 2001 From: Sergey Kozyrenko Date: Fri, 24 Jul 2026 02:41:02 +0700 Subject: [PATCH] fix(e2e): require E2E_BASE_URL for the local tier, like stand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The local tier fell back to https://localhost:8443 when E2E_BASE_URL was unset, while stand fail-fasts. Both tiers bake the real (paid) flow-run specs against a real backend, so a bare `E2E_TIER=local pnpm e2e` silently ran a real flow against the developer's dev stack — a paid LLM call, a junk flow, and a sandbox container/volume the wrapper cleanup never removes. Requires E2E_BASE_URL for local too; run-local-tier.sh already supplies it, so the legitimate path is unaffected. Verified: bare local now throws, local + E2E_BASE_URL loads clean. Co-Authored-By: Claude Opus 4.8 --- frontend/e2e/playwright.config.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/e2e/playwright.config.ts b/frontend/e2e/playwright.config.ts index 7d79338a..7d703576 100644 --- a/frontend/e2e/playwright.config.ts +++ b/frontend/e2e/playwright.config.ts @@ -26,7 +26,7 @@ const here = (relative: string) => fileURLToPath(new URL(relative, import.meta.u export const AUTH_STATE_PATH = here('./.auth/user.json'); const TIERS: Record = { - local: { baseURL: process.env.E2E_BASE_URL ?? 'https://localhost:8443', installMocks: false }, + local: { baseURL: process.env.E2E_BASE_URL ?? '', installMocks: false }, mock: { baseURL: `http://localhost:${PREVIEW_PORT}`, installMocks: true }, stand: { baseURL: process.env.E2E_BASE_URL ?? '', installMocks: false }, }; @@ -37,8 +37,11 @@ if (!(rawTier in TIERS)) { const tier = rawTier as BackendTier; -if (tier === 'stand' && !TIERS.stand.baseURL) { - throw new Error('E2E_TIER=stand requires E2E_BASE_URL'); +// Both stand and local hit a real backend and bake the real (paid) flow-run specs, so neither may +// fall back to a default: a bare `E2E_TIER=local` must not silently target the dev stack. run-local-tier.sh +// supplies E2E_BASE_URL for the legitimate path. +if ((tier === 'stand' || tier === 'local') && !TIERS[tier].baseURL) { + throw new Error(`E2E_TIER=${tier} requires E2E_BASE_URL`); } export default defineConfig({