frontend-quality-gates / FE-GATE-017 / diagram-review (pull_request) Skipped
frontend-quality-gates / main / self-tests and removal drills (pull_request) Skipped
frontend-quality-gates / merge / static checks (pull_request) Successful in 1m9s
frontend-quality-gates / merge / tests (pull_request) Successful in 10m55s
frontend-quality-gates / merge / browser tests (pull_request) Successful in 5m11s
frontend-quality-gates / FE-GATE-014 / config-compatibility (pull_request) Skipped
frontend-quality-gates / FE-GATE-028 / manual-accessibility-review (pull_request) Skipped
frontend-quality-gates / FE-GATE-026 / lab-performance (pull_request) Skipped
frontend-quality-gates / FE-GATE-015 / immutable-release-candidate (pull_request) Skipped
frontend-quality-gates / external-vulnerability-provider (pull_request) Skipped
frontend-quality-gates / external-provenance-provider (pull_request) Skipped
frontend-quality-gates / promote-verified-immutable-candidate (pull_request) Skipped
frontend-quality-gates / deploy-promoted-release (pull_request) Skipped
frontend-quality-gates / FE-GATE-019 / hosting-header (pull_request) Skipped
frontend-quality-gates / FE-GATE-021 / runbook-boot-config (pull_request) Skipped
frontend-quality-gates / FE-GATE-022 / runbook-chunk-mismatch (pull_request) Skipped
frontend-quality-gates / FE-GATE-023 / runbook-api-degradation (pull_request) Skipped
frontend-quality-gates / FE-GATE-024 / runbook-telemetry (pull_request) Skipped
frontend-quality-gates / FE-GATE-025 / runbook-release-rollback (pull_request) Skipped
frontend-quality-gates / FE-GATE-018 / field-web-vitals (pull_request) Skipped
This reverts commitb489589403, reversing changes made to9e1cfd5975. 문제: main run 376(b4895894)의 `main / self-tests and removal drills` job에서 FE-GATE-030이 실패한다. browser-file-storage 제거 드릴 사본에서 tests/unit/test-evidence-source-rules.test.ts 6건이 모두 같은 이유로 떨어진다. scripts/check-test-evidence.ts의 missingForbidOnly가 playwright.capabilities.config.ts를 읽다 ENOENT로 죽는다. #55가 forbidOnly 검사를 전체 검사에서 fixture 모드까지 모든 모드로 옮겼다. 드릴은 그 설정 파일을 지우지만 config/repository-layout.json의 playwright-configs 목록에는 그대로 남는다. 이 job은 main 단계에만 있어 PR run에서는 돌지 않았다. 고른 방법: CI 매뉴얼 9.3대로 main을 먼저 초록으로 돌리려고 #55 병합 커밋을 통째로 되돌린다(git revert -m 1b4895894). 되돌린 트리는9e1cfd59트리(9b3237dd)와 같다. 버린 대안: 그 자리에서 고치기(없는 설정을 건너뛰거나, 드릴이 목록에서도 빼기)는 어느 쪽이 맞는지 판단과 검증이 필요해 main 빨강이 길어진다. 고침은 #55를 다시 올리는 PR에서 한다. 위험·한계: #55의 고침 12커밋(검사기 진단과 시험 빈틈)이 main에서 빠진다. 다시 올릴 때 이 드릴(FE-GATE-030, main 단계)을 PR 쪽에서 따로 돌리지 않으면 같은 일이 다시 난다. 검증: desktop 공유 잠금 아래 test:browser-file-storage-removal.b4895894트리(7536337a) 3회 모두 rc=1(64·69·53초). 3회차 로그에서 6건 실패, 6건 모두 run 376과 같은 ENOENT(playwright.capabilities.config.ts).9e1cfd59트리(9b3237dd, 이 커밋의 트리) 1회 rc=0(92초). 로그 desktop /tmp/claude-gates/fe-run376-b489-removal/, fe-run376-9e1c-removal/.
97 lines
3.5 KiB
TypeScript
97 lines
3.5 KiB
TypeScript
import type { ConsoleMessage, Page } from "@playwright/test";
|
|
|
|
import { expect, test as base } from "./browser-test.ts";
|
|
import { trackPreloadUse } from "./preload-use.ts";
|
|
|
|
/**
|
|
* 1103/11-09. WebKit's guess, three seconds after the load event, that a
|
|
* preload went unused. It fired for chunks the page ran a moment later and
|
|
* missed preloads the page never ran once the test had ended. The fixture
|
|
* checks preload use itself, in every engine (`preloadunused:` below).
|
|
*/
|
|
const WEBKIT_UNUSED_PRELOAD_GUESS =
|
|
/^The resource \S+ was preloaded using link preload but not used within a few seconds from the window's load event\. Please make sure it wasn't preloaded for nothing\.$/u;
|
|
|
|
function ignoredConsole(message: ConsoleMessage) {
|
|
return (
|
|
message.type() === "warning" &&
|
|
(message.text().includes("NO_COLOR") ||
|
|
WEBKIT_UNUSED_PRELOAD_GUESS.test(message.text()))
|
|
);
|
|
}
|
|
|
|
/**
|
|
* 1105/11-01. What the strict `page` fixture does with every failure it
|
|
* recorded, once the test has ended.
|
|
*/
|
|
export type BrowserFailureVerdict = Readonly<{
|
|
judge(failures: readonly string[]): void;
|
|
}>;
|
|
|
|
export const test = base.extend<{
|
|
/**
|
|
* Browser failures a test provokes on purpose, matched against the recorded
|
|
* `console:…`, `pageerror:…`, `requestfailed:…` or `preloadunused:…` line
|
|
* (for example the browser's log line for a mocked 4xx, or the chunks
|
|
* preloaded with a chunk the test removed). Everything else still fails. One
|
|
* pattern, not an array: `test.use` reads an array as a `[value, options]`
|
|
* fixture tuple.
|
|
*/
|
|
allowedBrowserFailure: RegExp | undefined;
|
|
/**
|
|
* Fails the test for every recorded failure `allowedBrowserFailure` does not
|
|
* match. The record is made after the test body, where no test can read it,
|
|
* so tests/e2e/preload-use.spec.ts replaces this verdict to read what the
|
|
* fixture recorded and prove the record itself. No other spec replaces it.
|
|
*/
|
|
browserFailureVerdict: BrowserFailureVerdict;
|
|
}>({
|
|
allowedBrowserFailure: [undefined, { option: true }],
|
|
browserFailureVerdict: async ({ allowedBrowserFailure }, use) => {
|
|
await use(
|
|
Object.freeze({
|
|
judge(failures: readonly string[]) {
|
|
expect(
|
|
failures.filter(
|
|
(failure) => !allowedBrowserFailure?.test(failure),
|
|
),
|
|
"unexpected browser console/page errors",
|
|
).toEqual([]);
|
|
},
|
|
}),
|
|
);
|
|
},
|
|
page: async ({ page, browserFailureVerdict }, use) => {
|
|
const preloads = await trackPreloadUse(page);
|
|
const failures: string[] = [];
|
|
const onConsole = (message: ConsoleMessage) => {
|
|
if (
|
|
["error", "warning"].includes(message.type()) &&
|
|
!ignoredConsole(message)
|
|
) {
|
|
failures.push(`console:${message.type()}:${message.text()}`);
|
|
}
|
|
};
|
|
const onPageError = (error: Error) => {
|
|
failures.push(`pageerror:${error.name}`);
|
|
};
|
|
const onRequestFailed = (request: import("@playwright/test").Request) => {
|
|
failures.push(
|
|
`requestfailed:${request.method()}:${new URL(request.url()).pathname}:${request.failure()?.errorText ?? "unknown"}`,
|
|
);
|
|
};
|
|
page.on("console", onConsole);
|
|
page.on("pageerror", onPageError);
|
|
page.on("requestfailed", onRequestFailed);
|
|
await use(page);
|
|
failures.push(...(await preloads.check()).failures);
|
|
page.off("console", onConsole);
|
|
page.off("pageerror", onPageError);
|
|
page.off("requestfailed", onRequestFailed);
|
|
browserFailureVerdict.judge(failures);
|
|
},
|
|
});
|
|
|
|
export { expect };
|
|
export type { Page };
|