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

fork-follow-history: the follows the history test reads are built in three steps, each its own test #17260

opened this

Merged 43h 24m ago, live in production

fix/follow-history-split → main 0 commits 1 thread · 1 unresolved

  • Merged. fix/follow-history-split was merged into main as 0bcae71.

Review

Sign in to review this change.
1 file changed +18 −7
test/fork-follow-history.test.ts +18 −7
@@ -82,18 +82,29 @@ test("the empty state says when the next follow is due, or that following is off
8282 expect(page).toContain("data-follow-history-empty");
8383 });
8484
85 test("the last ten follows, newest first: commits taken, outcome, and where a conflict is held", async () => {
86 const fork = must(await forkRepo(app, carol, fresh(parent), "game-hist", { visibility: "public" }));
87 must(await takeOrTell(app, carol, fresh(fork)));
85 // The history is built in three steps, each its own test: one test of fourteen git writes, three
86 // follows and a page under one 5 s budget took 1.6 to 2.8 s alone and ran past it on loaded runners
87 // (4 checks of 2026-12-01 21:37 to 21:52Z). The steps run in order and share the fork.
88 let hist: Repo;

hist is shared mutable state between tests, so they only pass in file order and run alone they fail on an undefined repo. Fine for now; a beforeAll would make the dependency explicit.

89
90 test("the history: a first follow takes nothing new, a second takes upstream's two commits", async () => {
91 hist = must(await forkRepo(app, carol, fresh(parent), "game-hist", { visibility: "public" }));
92 must(await takeOrTell(app, carol, fresh(hist)));
8893 await commit(alice, parent, "h1.txt", "1\n");
8994 await commit(alice, parent, "h2.txt", "2\n");
90 must(await takeOrTell(app, carol, fresh(fork)));
91 await commit(carol, fork, "README.md", "# carol\n");
95 must(await takeOrTell(app, carol, fresh(hist)));
96 });
97
98 test("the history: a follow that conflicts is held for the crew", async () => {
99 await commit(carol, hist, "README.md", "# carol\n");
92100 await commit(alice, parent, "README.md", "# alice\n");
93101 must(await createAgent(app, alice, { username: "bot2", brief: "Be brief." }));
94 expect(addToCrew(app, carol, fresh(fork), "bot2").ok).toBe(true);
95 expect((await takeOrTell(app, carol, fresh(fork))).ok).toBe(false);
102 expect(addToCrew(app, carol, fresh(hist), "bot2").ok).toBe(true);
103 expect((await takeOrTell(app, carol, fresh(hist))).ok).toBe(false);
104 });
96105
106 test("the last ten follows, newest first: commits taken, outcome, and where a conflict is held", async () => {
107 const fork = hist;
97108 const h = await followHistoryOf(app, fresh(fork));
98109 expect(h.entries[0]!.outcome).toBe("conflict");
99110 expect(h.entries.at(-1)!.outcome).toBe("nothing_new");

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs