fix(e2e): require E2E_BASE_URL for the local tier, like stand

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 <noreply@anthropic.com>
This commit is contained in:
Sergey Kozyrenko
2026-07-24 02:41:02 +07:00
co-authored by Claude Opus 4.8
parent aec236d32e
commit ecfb2029ce
+6 -3
View File
@@ -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<BackendTier, { baseURL: string; installMocks: boolean }> = {
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<BackendOptions>({