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
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/4661-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork
1 file
changed +8
−6
test/releases-page.test.ts +8 −6
| @@ -13,6 +13,7 @@ import { createRepo } from "../src/actions/repos.ts"; | ||
| 13 | 13 | import { createApp, type App } from "../src/app.ts"; |
| 14 | 14 | import { createSession } from "../src/core/sessions.ts"; |
| 15 | 15 | import { createUser } from "../src/core/users.ts"; |
| 16 | import { migrations } from "../src/core/schema.ts"; | |
| 16 | 17 | import { serve, type Servers } from "../src/http/server.ts"; |
| 17 | 18 | import { releaseDir } from "../src/release/checkout.ts"; |
| 18 | 19 | import { recordRelease } from "../src/release/record.ts"; |
| @@ -29,6 +30,7 @@ describe("the releases page", () => { | ||
| 29 | 30 | let root = ""; |
| 30 | 31 | let app: App; |
| 31 | 32 | let servers: Servers; |
| 33 | let aliceCookie = ""; | |
| 32 | 34 | const was = process.env["FORGE_COMMIT"]; |
| 33 | 35 | |
| 34 | 36 | const login = async (username: string, password: string) => { |
| @@ -78,9 +80,11 @@ describe("the releases page", () => { | ||
| 78 | 80 | recordRelease(app.db, { sha: s, repoId, pullNumber: pull, ok: true, line }); |
| 79 | 81 | const dir = releaseDir(root, KEPT); |
| 80 | 82 | 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"); | |
| 82 | 84 | 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); | |
| 84 | 88 | afterAll(() => { |
| 85 | 89 | if (was === undefined) delete process.env["FORGE_COMMIT"]; |
| 86 | 90 | else process.env["FORGE_COMMIT"] = was; |
| @@ -90,8 +94,7 @@ describe("the releases page", () => { | ||
| 90 | 94 | }); |
| 91 | 95 | |
| 92 | 96 | 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(); | |
| 95 | 98 | expect(body).toContain("aaaaaaa"); |
| 96 | 99 | expect(body).toContain("bbbbbbb"); |
| 97 | 100 | expect(body).toContain("live"); |
| @@ -100,8 +103,7 @@ describe("the releases page", () => { | ||
| 100 | 103 | }); |
| 101 | 104 | |
| 102 | 105 | 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(); | |
| 105 | 107 | expect(body).toContain(`/releases/${KEPT}/rollback`); |
| 106 | 108 | expect(body).not.toContain(`/releases/${LIVE}/rollback`); |
| 107 | 109 | expect(body).not.toContain(`/releases/${PRUNED}/rollback`); |
new above
offline