fix: stop the smoke sweep reporting an expected 404 as a failure

A document with no preview yet answers 404 when the screen asks for its current
one, and the screen turns that into "make a preview". The sweep counted it as a
failure, so every run ended with the same red line under a healthy deployment.

A check that cries wolf on every run stops being read, and a real failure would
have sat unnoticed beside it. The session probe's 401 before sign-in is the
same kind of expected answer and is excluded on the same terms; every other
4xx and 5xx still fails the sweep.
This commit is contained in:
DongHyeonka
2026-08-21 18:00:14 +09:00
parent 348420618d
commit 7289ce97bb
+7 -3
View File
@@ -34,9 +34,13 @@ async function visit(
request(): { method(): string }; request(): { method(): string };
}) => { }) => {
const u = new URL(r.url()).pathname; const u = new URL(r.url()).pathname;
if (r.status() >= 400 && u.startsWith("/api") && !u.includes("/studio/session")) { if (r.status() < 400 || !u.startsWith("/api")) return;
problems.push(`${r.status()} ${r.request().method()} ${u}`); // 두 가지는 화면이 다루는 정상 상태다: 로그인 전 세션 탐침의 401, 그리고 아직 미리보기를
} // 만들지 않은 문서의 404. 이것들을 실패로 세면 매번 같은 줄이 뜨고, 진짜 실패가 그 사이에
// 묻힌다 — 늑대가 왔다고 매번 외치는 점검은 아무도 읽지 않는다.
if (u.includes("/studio/session")) return;
if (r.status() === 404 && r.request().method() === "GET" && u.endsWith("/preview")) return;
problems.push(`${r.status()} ${r.request().method()} ${u}`);
}; };
page.on("console", onConsole); page.on("console", onConsole);
page.on("response", onResponse); page.on("response", onResponse);