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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2uprnlv3zi is past its budget: trevato/forge: "the releases page > a writer gets a button on a kept release, not on the live or a pruned one" failed o… #4667

Merged opened this

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

Merged

scout/forge:scout/4661-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork

  • Merged. scout/4661-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as ed0de98.

Review

Sign in to review this change.
1 file changed +8 −6
test/releases-page.test.ts +8 −6
@@ -13,6 +13,7 @@ import { createRepo } from "../src/actions/repos.ts";
1313 import { createApp, type App } from "../src/app.ts";
1414 import { createSession } from "../src/core/sessions.ts";
1515 import { createUser } from "../src/core/users.ts";
16 import { migrations } from "../src/core/schema.ts";
1617 import { serve, type Servers } from "../src/http/server.ts";
1718 import { releaseDir } from "../src/release/checkout.ts";
1819 import { recordRelease } from "../src/release/record.ts";
@@ -29,6 +30,7 @@ describe("the releases page", () => {
2930 let root = "";
3031 let app: App;
3132 let servers: Servers;
33 let aliceCookie = "";
3234 const was = process.env["FORGE_COMMIT"];
3335
3436 const login = async (username: string, password: string) => {
@@ -78,9 +80,11 @@ describe("the releases page", () => {
7880 recordRelease(app.db, { sha: s, repoId, pullNumber: pull, ok: true, line });
7981 const dir = releaseDir(root, KEPT);
8082 mkdirSync(join(dir, "src", "core"), { recursive: true });
81 writeFileSync(join(dir, "src", "core", "schema.ts"), "export const migrations = " + JSON.stringify(Array(10_000).fill("SELECT 1")) + ";\n");
83 writeFileSync(join(dir, "src", "core", "schema.ts"), "export const migrations = " + JSON.stringify(Array(migrations.length + 1).fill("SELECT 1")) + ";\n");
8284 servers = await serve(app);
83 });
85 // Password hashing is the slow step under a loaded check machine: do it once, here, with room.
86 aliceCookie = await login("alice", "a-good-passphrase");
87 }, 60_000);
8488 afterAll(() => {
8589 if (was === undefined) delete process.env["FORGE_COMMIT"];
8690 else process.env["FORGE_COMMIT"] = was;
@@ -90,8 +94,7 @@ describe("the releases page", () => {
9094 });
9195
9296 test("it lists the releases, marks the live one and links the pull", async () => {
93 const cookie = await login("alice", "a-good-passphrase");
94 const body = await (await fetch(`${servers.url}/releases`, { headers: { cookie } })).text();
97 const body = await (await fetch(`${servers.url}/releases`, { headers: { cookie: aliceCookie } })).text();
9598 expect(body).toContain("aaaaaaa");
9699 expect(body).toContain("bbbbbbb");
97100 expect(body).toContain("live");
@@ -100,8 +103,7 @@ describe("the releases page", () => {
100103 });
101104
102105 test("a writer gets a button on a kept release, not on the live or a pruned one", async () => {
103 const cookie = await login("alice", "a-good-passphrase");
104 const body = await (await fetch(`${servers.url}/releases`, { headers: { cookie } })).text();
106 const body = await (await fetch(`${servers.url}/releases`, { headers: { cookie: aliceCookie } })).text();
105107 expect(body).toContain(`/releases/${KEPT}/rollback`);
106108 expect(body).not.toContain(`/releases/${LIVE}/rollback`);
107109 expect(body).not.toContain(`/releases/${PRUNED}/rollback`);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs