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

"the card lists the parent's commits > 12 commits show 10 and 'and 2 more'" passes every time on a loaded check machine #5674

Merged opened this

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

Merged

scout/forge:scout/5672-the-card-lists-the-parent-s-commits-12-c → main 1 commit fork

  • Merged. scout/5672-the-card-lists-the-parent-s-commits-12-c was merged into main as 1c150ce.

Review

Sign in to review this change.
1 file changed +18 −6
test/spawn-upstream-card.test.ts +18 −6
@@ -121,11 +121,21 @@ describe("the card lists the parent's commits", () => {
121121 let parent = "";
122122 let work = "";
123123 let ownerId = "";
124 const commit = async (n: number, subject: string) => {
124 // Each commit has its own fixed time, so no clock or load can tie or reorder them.
125 const commitOnly = async (n: number, subject: string) => {
126 const when = `${1_700_000_000 + n * 86_400} +0000`;
125127 await Bun.write(join(work, `g${n}.txt`), String(n));
126 await git(work, "add", ".");
127 await git(work, "commit", "-q", "-m", subject);
128 await git(work, "push", "-q", parent, "HEAD:refs/heads/main");
128 const env = { GIT_AUTHOR_DATE: when, GIT_COMMITTER_DATE: when };
129 const ident = ["-c", "user.name=t", "-c", "[email protected]"];
130 for (const args of [["add", "."], ["commit", "-q", "-m", subject]]) {
131 const r = await runGit([...ident, ...args], { cwd: work, env });
132 if (!r.ok) throw new Error(r.error.stderr);
133 }
134 };
135 const publish = () => git(work, "push", "-q", parent, "HEAD:refs/heads/main");
136 const commit = async (n: number, subject: string) => {
137 await commitOnly(n, subject);
138 await publish();
129139 };
130140 const setup = async (name: string) => {
131141 dir = await mkdtemp(join(tmpdir(), "forge-uplist-"));
@@ -156,7 +166,8 @@ describe("the card lists the parent's commits", () => {
156166
157167 test("3 commits, newest first", async () => {
158168 await setup("three");
159 for (const n of [1, 2, 3]) await commit(n, `subject ${n}`);
169 for (const n of [1, 2, 3]) await commitOnly(n, `subject ${n}`);
170 await publish();
160171 await checkUpstream(app, { remote: parent });
161172 const b = body();
162173 expect(b.indexOf("subject 3")).toBeGreaterThan(0);
@@ -168,7 +179,8 @@ describe("the card lists the parent's commits", () => {
168179
169180 test("12 commits show 10 and 'and 2 more'", async () => {
170181 await setup("twelve");
171 for (let n = 1; n <= 12; n++) await commit(n, `subject ${n}`);
182 for (let n = 1; n <= 12; n++) await commitOnly(n, `subject ${n}`);
183 await publish();
172184 await checkUpstream(app, { remote: parent });
173185 const b = body();
174186 expect(b.match(/ subject \d+\n/g)).toHaveLength(10);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs