Skip to content

Commit d5a7a1f

Browse files
test(server): declare looped checkpoint tests with it.effect.each
Upstream now forbids declaring tests inside for loops (#14921). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 986c697 commit d5a7a1f

2 files changed

Lines changed: 41 additions & 43 deletions

File tree

‎apps/server/src/checkpointing/CheckpointDiffQuery.test.ts‎

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -289,43 +289,41 @@ it.effect("still requires the prior checkpoint when no start ref exists", () =>
289289
}).pipe(Effect.provide(layer));
290290
});
291291

292-
for (const hasStartSnapshot of [false, true]) {
293-
it.effect(
294-
`uses ${hasStartSnapshot ? "fresh" : "legacy"} baseline for an individual V2 turn`,
295-
() => {
296-
const projection = makeProjection();
297-
const firstRef = checkpointRefForScopeOrdinal({
298-
scopeId: firstScopeId,
299-
ordinalWithinScope: 1,
300-
});
301-
const diffCheckpoints = vi.fn((_input: CheckpointStore.DiffCheckpointsInput) =>
302-
Effect.succeed("patch"),
292+
it.effect.each([false, true])(
293+
"uses the fresh baseline for an individual V2 turn when it has a start snapshot: %s",
294+
(hasStartSnapshot) => {
295+
const projection = makeProjection();
296+
const firstRef = checkpointRefForScopeOrdinal({
297+
scopeId: firstScopeId,
298+
ordinalWithinScope: 1,
299+
});
300+
const diffCheckpoints = vi.fn((_input: CheckpointStore.DiffCheckpointsInput) =>
301+
Effect.succeed("patch"),
302+
);
303+
const layer = makeLayer({
304+
hasStartSnapshot,
305+
diffCheckpoints,
306+
projection: Effect.succeed({
307+
...projection,
308+
checkpoints: [
309+
...projection.checkpoints,
310+
{
311+
scopeId: firstScopeId,
312+
runId: firstRunId,
313+
appRunOrdinal: 1,
314+
status: "ready",
315+
ref: firstRef,
316+
},
317+
],
318+
}),
319+
});
320+
return Effect.gen(function* () {
321+
const query = yield* CheckpointDiffQuery.CheckpointDiffQuery;
322+
yield* query.getTurnDiff({ threadId, fromTurnCount: 1, toTurnCount: 2 });
323+
assert.equal(
324+
diffCheckpoints.mock.calls[0]?.[0].fromCheckpointRef,
325+
hasStartSnapshot ? checkpointStartRef(secondRef) : firstRef,
303326
);
304-
const layer = makeLayer({
305-
hasStartSnapshot,
306-
diffCheckpoints,
307-
projection: Effect.succeed({
308-
...projection,
309-
checkpoints: [
310-
...projection.checkpoints,
311-
{
312-
scopeId: firstScopeId,
313-
runId: firstRunId,
314-
appRunOrdinal: 1,
315-
status: "ready",
316-
ref: firstRef,
317-
},
318-
],
319-
}),
320-
});
321-
return Effect.gen(function* () {
322-
const query = yield* CheckpointDiffQuery.CheckpointDiffQuery;
323-
yield* query.getTurnDiff({ threadId, fromTurnCount: 1, toTurnCount: 2 });
324-
assert.equal(
325-
diffCheckpoints.mock.calls[0]?.[0].fromCheckpointRef,
326-
hasStartSnapshot ? checkpointStartRef(secondRef) : firstRef,
327-
);
328-
}).pipe(Effect.provide(layer));
329-
},
330-
);
331-
}
327+
}).pipe(Effect.provide(layer));
328+
},
329+
);

‎apps/server/src/orchestration-v2/runtimeLayer.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3771,8 +3771,9 @@ it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => {
37713771
});
37723772

37733773
it.layer(SharedApplicationDataPlaneTestLayer)("pending provider interruption", (it) => {
3774-
for (const scenario of ["pending", "captured", "later-baseline"] as const) {
3775-
it.effect(`interrupts ${scenario} startup and reclaims only its abandoned baseline`, () =>
3774+
it.effect.each(["pending", "captured", "later-baseline"] as const)(
3775+
"interrupts %s startup and reclaims only its abandoned baseline",
3776+
(scenario) =>
37763777
Effect.gen(function* () {
37773778
const projects = yield* ProjectService.ProjectService;
37783779
const orchestrator = yield* Orchestrator.OrchestratorV2;
@@ -3912,8 +3913,7 @@ it.layer(SharedApplicationDataPlaneTestLayer)("pending provider interruption", (
39123913
}
39133914
assert.isFalse(yield* effectWorker.runOnce);
39143915
}).pipe(Effect.scoped),
3915-
);
3916-
}
3916+
);
39173917
});
39183918

39193919
it.layer(SharedApplicationDataPlaneTestLayer)("snooze projection", (it) => {

0 commit comments

Comments
 (0)