Files
DongHyeonka c239bdf4d5
frontend-quality-gates / merge / static checks (pull_request) Successful in 1m45s
frontend-quality-gates / merge / browser tests (pull_request) Successful in 7m53s
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 / 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 / merge / tests (pull_request) Successful in 15m11s
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
ci(gates): browser job 컨테이너의 /dev/shm을 2 GB로 연다
CI job 컨테이너의 /dev/shm은 Docker 기본값 64 MB다. 그래서 앞 커밋의
Firefox RAM 프로필이 CI에서는 켜지지 않는다. 프로필은 runner 디스크에
남고, 이유가 한 줄 찍힌다. main run 266(ee95573f)도 같은 꼴로
빨갛다. FE-GATE-009 [firefox] generated-feature.spec.ts:380에서 첫
화면(로그인 heading) 5초 대기를 넘겼다.

생성기가 Playwright 이미지를 쓰는 job 컨테이너에
`options: "--shm-size=2g"`를 붙인다(BROWSER_JOB_SHARED_MEMORY). 2 GB는
Firefox worker 6개 프로필 합 최대 211 MB와 fixture가 요구하는 worker당
64 MB에 여유를 둔 값이다. job 메모리 상한 10 GB 안에서 쓴다.
ci-quality-gates.md에 한 줄을 적었다.

버린 대안: runner 설정 `container.options`에 같은 값을 두는 안(계획
D-4 (가))은 운영 설정이라 소유자 실행 묶음에 있다. 그것이 적용되면 이
줄은 지워도 된다.

위험·한계: runner는 `privileged: false`다. act_runner가 workflow의 이
옵션을 무시하면 프로필은 그대로 디스크에 남고, FE-GATE-008·009 로그에
「Firefox profiles stay on disk」 줄이 남는다. runner run에서 그 줄이
없는지로 확인한다.

검증(desktop): generate:ci-workflow로 workflow와 snapshot 갱신,
ci-browser-image·ci-workflow-generation 시험 449 passed, check:ci-workflow,
check:types:node, eslint, scripts/verify.sh docs, verify:documentation 통과.
2026-11-13 19:34:18 +09:00

55 lines
2.5 KiB
TypeScript

import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
import { loadCiGateContract, PLAYWRIGHT_JOB_IMAGE_PATTERN } from "../../scripts/contracts/ci-gates.ts";
import { BROWSER_JOB_SHARED_MEMORY, renderCiWorkflow } from "../../scripts/generate-ci-workflow.ts";
/**
* merge_browser runs in Playwright's own image so it does not download the
* browsers and their OS libraries in every job (about 900 MB, 200 to 240 s on
* the runner). The image's browsers are the ones @playwright/test of the same
* version expects; a Playwright update without the image left the browsers
* missing (or the image without the version's revisions).
*/
describe("browser job image", () => {
it("is Playwright's image for the pinned @playwright/test version, by digest", async () => {
const pinned = (
JSON.parse(readFileSync("package.json", "utf8")) as { devDependencies: Record<string, string> }
).devDependencies["@playwright/test"];
const contract = await loadCiGateContract(process.cwd());
const images = contract.jobs.flatMap((job) =>
job.steps.flatMap((step) => (step.kind === "browser-install" && step.image ? [[job.id, step.image] as const] : [])),
);
expect(images.map(([jobId]) => jobId)).toEqual(["merge_browser"]);
for (const [, image] of images) {
expect(PLAYWRIGHT_JOB_IMAGE_PATTERN.exec(image)?.[1]).toBe(pinned);
}
});
it("is the job container, and the runner image the build records", async () => {
const contract = await loadCiGateContract(process.cwd());
const image = contract.jobs
.find(({ id }) => id === "merge_browser")!
.steps.find((step) => step.kind === "browser-install");
const workflow = renderCiWorkflow(contract);
const job = workflow.slice(workflow.indexOf(" merge_browser:\n"), workflow.indexOf(" release_gate:\n"));
expect(image?.kind === "browser-install" && image.image).toBeTruthy();
const ref = image?.kind === "browser-install" ? image.image! : "";
expect(job).toContain(
` container:\n image: "${ref}"\n options: "--shm-size=${BROWSER_JOB_SHARED_MEMORY}"\n`,
);
expect(job).toContain(` env:\n CI_RUNNER_IMAGE: "${ref}"\n`);
expect(job).not.toContain("playwright install");
});
it("refuses an image outside Playwright's registry or without a digest", async () => {
for (const image of [
"mcr.microsoft.com/playwright:v1.62.0-noble",
"docker.io/library/ubuntu:24.04@sha256:" + "a".repeat(64),
]) {
expect(PLAYWRIGHT_JOB_IMAGE_PATTERN.test(image), image).toBe(false);
}
});
});