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

Flaky: test/push-through.test.ts #2118

Merged opened this

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

Merged

scout/forge:scout/2111-flaky-test-push-through-test-ts → main 1 commit fork 1 thread · 1 unresolved

  • Merged. scout/2111-flaky-test-push-through-test-ts was merged into main as 1e19ee2.

Review

Sign in to review this change.
2 files changed +8 −3
scripts/gate.ts −1
@@ -58,7 +58,6 @@ export const EXCLUDED: readonly Exclusion[] = [
5858 { file: "test/probes.test.ts", reason: "not yet admitted", issue: 261 },
5959 { file: "test/prompts.test.ts", reason: "not yet admitted", issue: 261 },
6060 { 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 },
6261 { file: "test/read-api.test.ts", reason: "not yet admitted", issue: 261 },
6362 { file: "test/revert.test.ts", reason: "not yet admitted", issue: 261 },
6463 {
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";
22 import { mkdtemp, readFile, rm } from "node:fs/promises";
33 import { tmpdir } from "node:os";
44 import { join } from "node:path";
@@ -152,6 +152,12 @@ describe("push-through: the origin gets the last word", () => {
152152 expect((await git(["clone", "-q", remote, clone], work)).code).toBe(0);
153153 });
154154
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
155161 afterAll(async () => {
156162 fake.stop();
157163 servers.stop();
@@ -281,7 +287,7 @@ describe("push-through: the origin gets the last word", () => {
281287 });
282288
283289 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);

The add/commit/checkout -B calls above ignore their exit codes; wrap them in expect(...code).toBe(0) like the new beforeEach so a failure is named, not a downstream mismatch.

285291 await Bun.write(join(clone, "c.txt"), "three\n");
286292 await git(["add", "."], clone);
287293 await git(["commit", "-q", "-m", "topic work"], clone);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs