Public: anyone can read this; the crew can change it.
Flaky: test/push-through.test.ts #2118
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/2111-flaky-test-push-through-test-ts → main 1 commit fork 1 thread · 1 unresolved
2 files
changed +8
−3
scripts/gate.ts −1
| @@ -58,7 +58,6 @@ export const EXCLUDED: readonly Exclusion[] = [ | ||
| 58 | 58 | { file: "test/probes.test.ts", reason: "not yet admitted", issue: 261 }, |
| 59 | 59 | { file: "test/prompts.test.ts", reason: "not yet admitted", issue: 261 }, |
| 60 | 60 | { file: "test/public-url.test.ts", reason: "not yet admitted", issue: 261 }, |
| 61 | { file: "test/push-through.test.ts", reason: "not yet admitted", issue: 261 }, | |
| 62 | 61 | { file: "test/read-api.test.ts", reason: "not yet admitted", issue: 261 }, |
| 63 | 62 | { file: "test/revert.test.ts", reason: "not yet admitted", issue: 261 }, |
| 64 | 63 | { |
test/push-through.test.ts +8 −2
| @@ -1,4 +1,4 @@ | ||
| 1 | import { afterAll, beforeAll, describe, expect, test } from "bun:test"; | |
| 1 | import { afterAll, beforeAll, beforeEach, describe, expect, test } from "bun:test"; | |
| 2 | 2 | import { mkdtemp, readFile, rm } from "node:fs/promises"; |
| 3 | 3 | import { tmpdir } from "node:os"; |
| 4 | 4 | import { join } from "node:path"; |
| @@ -152,6 +152,12 @@ describe("push-through: the origin gets the last word", () => { | ||
| 152 | 152 | expect((await git(["clone", "-q", remote, clone], work)).code).toBe(0); |
| 153 | 153 | }); |
| 154 | 154 | |
| 155 | // The clone is shared, so each test starts on `main`: the topic test leaves | |
| 156 | // HEAD on `topic`, and a later `push origin main` would then push nothing. | |
| 157 | beforeEach(async () => { | |
| 158 | expect((await git(["checkout", "-q", "-f", "main"], clone)).code).toBe(0); | |
| 159 | }); | |
| 160 | ||
| 155 | 161 | afterAll(async () => { |
| 156 | 162 | fake.stop(); |
| 157 | 163 | servers.stop(); |
| @@ -281,7 +287,7 @@ describe("push-through: the origin gets the last word", () => { | ||
| 281 | 287 | }); |
| 282 | 288 | |
| 283 | 289 | test("a new branch is created upstream, and a deletion is forwarded", async () => { |
| 284 | await git(["checkout", "-q", "-b", "topic"], clone); | |
| 290 | await git(["checkout", "-q", "-B", "topic"], clone); | |
| 285 | 291 | await Bun.write(join(clone, "c.txt"), "three\n"); |
| 286 | 292 | await git(["add", "."], clone); |
| 287 | 293 | await git(["commit", "-q", "-m", "topic work"], clone); |
new above
offline
The
add/commit/checkout -Bcalls above ignore their exit codes; wrap them inexpect(...code).toBe(0)like the new beforeEach so a failure is named, not a downstream mismatch.