From a06cc8e4c461daebc4d1a2b54cb394b8accda8b4 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 12:50:28 +0900 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=EC=8B=9C=ED=97=98=EA=B3=BC=20dev=20?= =?UTF-8?q?server=EA=B0=80=20CI=EC=9D=98=20=EB=B9=8C=EB=93=9C=20=EC=8B=9D?= =?UTF-8?q?=EB=B3=84=EA=B0=92=EC=9D=84=20=EB=AC=BC=EB=A0=A4=EB=B0=9B?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI workflow는 전체 env에 VITE_BUILD_ID=gitea--와 VITE_COMMIT_SHA를 둔다. Vite는 이 값을 import.meta.env에 넣는다. 그래서 CI와 같은 env로 돌리면 앱을 local-build fixture release로 조립하는 시험 (runtime-application, boot-unexpected-failure, runtime-composition-service-worker-telemetry)이 CONFIG_BUILD_MISMATCH로 실패한다. 로컬에서는 값이 없어 늘 통과한다. 템플릿 af312dee를 그대로 가져온다. vitest.config.ts가 두 값을 지우고, dev server를 띄우는 Playwright 설정 둘은 webServer env로 VITE_BUILD_ID=local-build, VITE_COMMIT_SHA=local을 준다. build·preview를 쓰는 설정은 빌드가 같은 값으로 config.json을 만들므로 그대로 둔다. 위험·한계: vitest 안에서 CI 빌드 식별값을 검사하려는 시험은 값을 직접 넣어야 한다(지금은 없다). capability e2e(FE-GATE-008)는 돌리지 않았다. 검증: VITE_BUILD_ID를 준 채로 세 component 시험이 통과한다. --- playwright.capabilities.config.ts | 5 +++++ playwright.dev.config.ts | 5 +++++ vitest.config.ts | 8 ++++++++ 3 files changed, 18 insertions(+) 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.