Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3vwjk71z5u is past its budget: trevato/forge: "a page that answers 200 names its canonical address, equal to og:url; a 404 names none" failed on 3 pul… #8238

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

mason/forge:mason/8233-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork

  • Merged. mason/8233-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as d2a27b9.

Review

Sign in to review this change.
1 file changed +7 −3
test/forge-webspec.test.ts +7 −3
@@ -24,6 +24,9 @@ quietLogs();
2424
2525 const PATHS = ["/", "/signin", "/signup", "/explore", "/alice/notes", "/alice/notes/issues", "/alice/notes/issues/1", "/alice/notes/tree/main", "/alice/notes/blob/main/a.txt"];
2626
27 /** A person's browser: a request with no User-Agent counts against the crawl budget (#8129), which shrinks while the check machine is loaded, so these tests are never crawlers. */
28 const BROWSER = { "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/120.0 Safari/537.36" };
29
2730 const CACHING = "https://specification.website/#caching";
2831
2932 /** `check path` -> [section, why it stands]. Every one is expected on every page it names; one fixed fails the test, one new fails it too. */
@@ -90,6 +93,7 @@ afterAll(async () => {
9093 const through = (signedIn: boolean) => async (input: string, init?: RequestInit) => {
9194 const request = new Request(input, init);
9295 if (signedIn) request.headers.set("cookie", cookie);
96 if (!request.headers.has("user-agent")) request.headers.set("user-agent", BROWSER["user-agent"]);
9397 if (!request.headers.has("accept-encoding")) request.headers.set("accept-encoding", "br, gzip");
9498 const response = await compress(request, await http.handle(request)).then(securityFloor);
9599 const encoding = response.headers.get("content-encoding");
@@ -120,7 +124,7 @@ test("the owner's signed-in pages raise exactly the findings named in KNOWN_SIGN
120124
121125 test("a page that answers 200 names its canonical address, equal to og:url; a 404 names none", async () => {
122126 const head = async (path: string) => {
123 const res = await http.handle(new Request(`http://forge.test${path}`));
127 const res = await http.handle(new Request(`http://forge.test${path}`, { headers: BROWSER }));
124128 return { status: res.status, html: await res.text() };
125129 };
126130 for (const path of ["/", "/explore", "/alice/notes", "/explore?x=1"]) {
@@ -138,12 +142,12 @@ test("a page that answers 200 names its canonical address, equal to og:url; a 40
138142
139143 test("the walked signed-in pages answer 200 for the owner", async () => {
140144 for (const path of SIGNED_IN) {
141 expect((await http.handle(new Request(`http://forge.test${path}`, { headers: { cookie } }))).status).toBe(200);
145 expect((await http.handle(new Request(`http://forge.test${path}`, { headers: { cookie, ...BROWSER } }))).status).toBe(200);
142146 }
143147 });
144148
145149 test("the walked repository pages exist", async () => {
146150 for (const path of ["/alice/notes", "/alice/notes/issues", "/alice/notes/issues/1"]) {
147 expect((await http.handle(new Request(`http://forge.test${path}`))).status).toBe(200);
151 expect((await http.handle(new Request(`http://forge.test${path}`, { headers: BROWSER }))).status).toBe(200);
148152 }
149153 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs