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

test/crew-wrapup.test.ts runs in under 10 s, every test under 1 s, proving what it proves today #10223

Merged opened this

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

Merged

scout/forge:scout/10214-test-crew-wrapup-test-ts-runs-in-under-1 → main 1 commit fork

  • Merged. scout/10214-test-crew-wrapup-test-ts-runs-in-under-1 was merged into main as 0bb904c.

Review

Sign in to review this change.
1 file changed +6 −1
test/crew-wrapup.test.ts +6 −1
@@ -66,7 +66,7 @@ describe("a run that spends its budget", () => {
6666 run.state === "cancelled")
6767 )
6868 return run;
69 await Bun.sleep(100);
69 await Bun.sleep(20);
7070 }
7171 throw new Error("agent run did not settle");
7272 }
@@ -135,6 +135,8 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"Added CREW
135135 concurrency: 1,
136136 budgetUsd: 2,
137137 runTimeoutMs: 60_000,
138 // The pump picks queued runs on a tick; 5 s by default, 20 ms here.
139 tickMs: 20,
138140 });
139141 const a = await createUser(app.db, { origin: "seed", trusted: true,
140142 username: "alice",
@@ -169,6 +171,7 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"Added CREW
169171 });
170172
171173 test("gets one wrap-up turn in the same session, on the reserve", async () => {
174 // Invariant: a run that spends its working budget resumes its session once, on the reserve, and lands a pull.
172175 const { run, number } = await assigned(
173176 "Plant tulips",
174177 "Along the fence. BUDGET-ME",
@@ -207,6 +210,7 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"Added CREW
207210 }, 60_000);
208211
209212 test("a run that finishes on its own gets no wrap-up", async () => {
213 // Invariant: a run that completes within its working budget is invoked exactly once.
210214 const { run, number } = await assigned("Plant roses", "Along the wall.");
211215 expect(run.state).toBe("ok");
212216 expect(run.summary).toMatch(/^opened pull #\d+( \([0-9a-f]{7,40}\))?$/);
@@ -221,6 +225,7 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"Added CREW
221225 }, 60_000);
222226
223227 test("a wrap-up that runs out as well lands as before, and gets no third turn", async () => {
228 // Invariant: a wrap-up that also runs out is the last turn; the leftover work is committed and opened.
224229 const { run, number } = await assigned(
225230 "Plant ivy",
226231 "Up the shed. BUDGET-ME-TWICE",

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs