diff --git a/playwright.capabilities.config.ts b/playwright.capabilities.config.ts index b62dc4b..7097233 100644 --- a/playwright.capabilities.config.ts +++ b/playwright.capabilities.config.ts @@ -30,6 +30,11 @@ export default defineConfig({ "corepack pnpm dev --host 127.0.0.1 --port 4174", url: "http://127.0.0.1:4174", reuseExistingServer: false, + // Template af312dee. The dev server serves public/config.json, the local + // profile, whose BUILD_ID is local-build. CI sets VITE_BUILD_ID for the whole + // workflow; built into the dev bundle it makes every page a rolling-release + // mismatch that reloads once and then fails closed (CONFIG_BUILD_MISMATCH). + env: { VITE_BUILD_ID: "local-build", VITE_COMMIT_SHA: "local" }, }, projects: [ { diff --git a/playwright.dev.config.ts b/playwright.dev.config.ts index 95cc321..2fc83fe 100644 --- a/playwright.dev.config.ts +++ b/playwright.dev.config.ts @@ -12,5 +12,10 @@ export default defineConfig({ command: "corepack pnpm dev --host 127.0.0.1", url: "http://127.0.0.1:5173", reuseExistingServer: true, + // Template af312dee. The dev server serves public/config.json, the local + // profile, whose BUILD_ID is local-build. CI sets VITE_BUILD_ID for the whole + // workflow; built into the dev bundle it makes every page a rolling-release + // mismatch that reloads once and then fails closed (CONFIG_BUILD_MISMATCH). + env: { VITE_BUILD_ID: "local-build", VITE_COMMIT_SHA: "local" }, }, }); diff --git a/vitest.config.ts b/vitest.config.ts index ba3e421..b7b293e 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -6,6 +6,14 @@ import { configDefaults, defineConfig } from "vitest/config"; // protects direct `vitest` invocations as well. process.env.NODE_ENV = "test"; +// Template af312dee. CI sets VITE_BUILD_ID and VITE_COMMIT_SHA for the whole +// workflow (.gitea/workflows/quality-gates.yml). Vite builds them into +// `import.meta.env`, so a test that composes the app against its local-build +// fixture release saw CONFIG_BUILD_MISMATCH in CI and passed everywhere else. +// Tests start with the local build identity. +delete process.env["VITE_BUILD_ID"]; +delete process.env["VITE_COMMIT_SHA"]; + // tests/system needs CI-runner host facilities (see docs/testing/taxonomy.md). // It runs only when a caller names it, as `test:system` does; a bare `vitest` // run leaves it out.