Public: anyone can read this; the crew can change it.
Flaky: test/revert.test.ts #2119
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/2112-flaky-test-revert-test-ts → main 1 commit fork
2 files
changed +8
−7
scripts/gate.ts −1
| @@ -60,7 +60,6 @@ export const EXCLUDED: readonly Exclusion[] = [ | ||
| 60 | 60 | { file: "test/public-url.test.ts", reason: "not yet admitted", issue: 261 }, |
| 61 | 61 | { file: "test/push-through.test.ts", reason: "not yet admitted", issue: 261 }, |
| 62 | 62 | { file: "test/read-api.test.ts", reason: "not yet admitted", issue: 261 }, |
| 63 | { file: "test/revert.test.ts", reason: "not yet admitted", issue: 261 }, | |
| 64 | 63 | { |
| 65 | 64 | file: "test/reviews-states.test.ts", |
| 66 | 65 | reason: "not yet admitted", |
test/revert.test.ts +8 −6
| @@ -6,7 +6,7 @@ | ||
| 6 | 6 | * `git clone`/`git push` over HTTP, which does not run in this sandbox. |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | import { afterAll, beforeAll, describe, expect, test } from "bun:test"; | |
| 9 | import { afterEach, beforeEach, describe, expect, test } from "bun:test"; | |
| 10 | 10 | import { mkdtemp, rm } from "node:fs/promises"; |
| 11 | 11 | import { tmpdir } from "node:os"; |
| 12 | 12 | import { join } from "node:path"; |
| @@ -68,7 +68,7 @@ describe("take it back: reverting a shipped change, headless", () => { | ||
| 68 | 68 | return getPull(app.db, repo.id, opened.value.number)!; |
| 69 | 69 | }; |
| 70 | 70 | |
| 71 | beforeAll(async () => { | |
| 71 | beforeEach(async () => { | |
| 72 | 72 | dataDir = await mkdtemp(join(tmpdir(), "forge-revert-")); |
| 73 | 73 | app = createApp({ dataDir, port: 0 }); |
| 74 | 74 | |
| @@ -96,7 +96,7 @@ describe("take it back: reverting a shipped change, headless", () => { | ||
| 96 | 96 | }); |
| 97 | 97 | }); |
| 98 | 98 | |
| 99 | afterAll(async () => { | |
| 99 | afterEach(async () => { | |
| 100 | 100 | app.close(); |
| 101 | 101 | await rm(dataDir, { recursive: true, force: true }); |
| 102 | 102 | }); |
| @@ -126,7 +126,9 @@ describe("take it back: reverting a shipped change, headless", () => { | ||
| 126 | 126 | }); |
| 127 | 127 | |
| 128 | 128 | test("a change already taken back is refused rather than reverted twice", async () => { |
| 129 | const shipped = getPull(app.db, repo.id, 1)!; | |
| 129 | const shipped = await shipChange("loud", "Make it loud", "alpha\nBETA\n"); | |
| 130 | const first = await revertPull(app, alice, repo, shipped); | |
| 131 | expect(first.ok).toBe(true); | |
| 130 | 132 | const again = await revertPull(app, alice, repo, shipped); |
| 131 | 133 | expect(again).toEqual({ ok: false, error: "already_reverted" }); |
| 132 | 134 | expect(revertOf(app.db, repo.id, shipped.id)).toBeDefined(); |
| @@ -154,7 +156,7 @@ describe("take it back: reverting a shipped change, headless", () => { | ||
| 154 | 156 | const shipped = await shipChange( |
| 155 | 157 | "epsilon", |
| 156 | 158 | "Add epsilon", |
| 157 | "alpha\nDELTA\nEPSILON\n", | |
| 159 | "alpha\nEPSILON\n", | |
| 158 | 160 | ); |
| 159 | 161 | const refused = await revertPull(app, agent.value.user, repo, shipped); |
| 160 | 162 | expect(refused).toEqual({ ok: false, error: "forbidden" }); |
| @@ -165,7 +167,7 @@ describe("take it back: reverting a shipped change, headless", () => { | ||
| 165 | 167 | branch: "zeta", |
| 166 | 168 | base: "main", |
| 167 | 169 | message: "not merged", |
| 168 | files: [{ path: "code.txt", content: "alpha\nDELTA\nZETA\n" }], | |
| 170 | files: [{ path: "code.txt", content: "alpha\nZETA\n" }], | |
| 169 | 171 | }); |
| 170 | 172 | const opened = await openPull(app, alice, repo, { |
| 171 | 173 | title: "Add zeta", |
new above
offline