Files
clean-architecture-frontend…/playwright.capabilities.config.ts
DongHyeonka c1e258bb81 test(playwright): CI 판정용 재시도로 흔들림을 가리고 실패로 남긴다
Playwright가 재시도하지 않아 실패가 흔들림인지 회귀인지 run에 남지
않는다. CI=true에서만 한 번 더 돌고, 재시도에서 통과해도 실패로
끝낸다. 설정 helper로만 주고 검사기가 설정 객체의 key를 거절한다.

failOnFlakyTests만으로는 재시도에서만 test.fail()에 닿은 시험의 첫
실패가 통과로 바뀐다. helper의 reporter가 실패한 시도를 따로 판정하고
다른 보고에 없는 원인을 색 코드 없이 찍는다. e2e 공유 fixture 빌드는 재시도에서 앞
시도의 실패 기록을 다시 쓰지 않는다(카드 C9). package script와 게이트
args는 029 파서와 이어 쓴 script 때문에 버렸다. CI 판별은 러너 정책이라
CI env를 읽는다.

위험·한계: 많이 깨진 run은 브라우저 게이트가 최대 약 두 배 걸린다
(추정). 명령줄 --reporter는 이 판정 reporter를 뺀다. JUnit에서 실패한
시험의 시간과 failure/error 분류는 첫 시도 기준이 된다. 검사기는 spec
안의 describe.configure({ retries })를 보지 않는다. 빌드가 실패 기록
없이 끊기면(worker 종료, hook 시간 초과) 재시도도 기다리다 실패한다.

검증: main으로 옮기기 전 트리 c8df70ab에서 test:unit 3632개, types,
lint, FE-GATE-029, verify:documentation rc=0, 변이 30개 검출. desktop
실제 브라우저: 일시 빌드 실패는 6 flaky, 계속 실패는 3 failed, 숨은
실패는 rc=1과 원인 출력. 트리 3dea9c06에서 숨은 expect 실패의 색 코드
시험이 고치기 전 1개 실패, 고친 뒤 35개 통과.

Refs: CI-FE-0001
2026-11-23 00:45:11 +09:00

73 lines
2.2 KiB
TypeScript

import { defineConfig, devices } from "@playwright/test";
import { LOCAL_BUILD_IDENTITY } from "./scripts/lib/build-environment.ts";
import { flakyJudgement, flakyJudgementReporter } from "./scripts/lib/playwright-flaky-judgement.ts";
import {
reservePort,
RUN_OUTPUT_ROOT_VARIABLE,
TEST_PORT_VARIABLES,
testRunPath,
testRunRoot,
} from "./scripts/lib/run-isolation.ts";
// 1105/12-04. Under TEST_RUN_ID the results and report are the run's own
// (.tmp/runs/<id>/), and so is the dev server's Vite cache. The dev server
// listens on a free port (TEST_CAPABILITIES_PORT pins one); it shared 4174
// with the visual preview. Specs read the origin from `use.baseURL`.
const port = await reservePort(TEST_PORT_VARIABLES.capabilities);
const origin = `http://127.0.0.1:${port}`;
export default defineConfig({
testDir: "./tests/browser-capabilities",
forbidOnly: true,
...flakyJudgement(),
outputDir: testRunPath("artifacts/tests/browser-capabilities/results"),
reporter: [
["list"],
flakyJudgementReporter,
[
"html",
{
outputFolder: testRunPath("artifacts/tests/browser-capabilities/report"),
open: "never",
},
],
[
"junit",
{
outputFile: testRunPath("artifacts/tests/browser-capabilities/results.xml"),
includeRetries: true,
},
],
],
use: {
baseURL: origin,
trace: "retain-on-failure",
screenshot: "only-on-failure",
},
webServer: {
// 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: { ...LOCAL_BUILD_IDENTITY, [RUN_OUTPUT_ROOT_VARIABLE]: testRunRoot() },
command: `corepack pnpm dev --host 127.0.0.1 --port ${port} --strictPort`,
url: origin,
reuseExistingServer: false,
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},
{
name: "webkit",
use: { ...devices["Desktop Safari"] },
},
],
});