Skip to content

Commit cbca410

Browse files
committed
test: add e2e tests for session continuity and deploy --plan
1 parent ec3d007 commit cbca410

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

e2e-tests/e2e-helper.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,62 @@ export function createE2ESuite(cfg: E2EConfig) {
261261
},
262262
120000
263263
);
264+
265+
it.skipIf(!canRun)(
266+
'invoke maintains conversation continuity with session ID',
267+
async () => {
268+
const sessionId = `e2e-session-${randomUUID()}`;
269+
270+
// First turn: say something memorable
271+
await retry(
272+
async () => {
273+
const r1 = await run([
274+
'invoke',
275+
'--prompt',
276+
'Remember this word: pineapple',
277+
'--agent',
278+
agentName,
279+
'--session-id',
280+
sessionId,
281+
'--json',
282+
]);
283+
expect(r1.exitCode, `First turn failed (stdout: ${r1.stdout}, stderr: ${r1.stderr})`).toBe(0);
284+
},
285+
3,
286+
10000
287+
);
288+
289+
// Second turn: ask for it back
290+
const r2 = await run([
291+
'invoke',
292+
'--prompt',
293+
'What word did I ask you to remember?',
294+
'--agent',
295+
agentName,
296+
'--session-id',
297+
sessionId,
298+
'--json',
299+
]);
300+
expect(r2.exitCode, `Second turn failed: ${r2.stderr}`).toBe(0);
301+
302+
const json = parseJsonOutput(r2.stdout) as { success: boolean; response?: string };
303+
expect(json.success).toBe(true);
304+
expect(json.response?.toLowerCase(), 'Response should reference the word from the first turn').toContain(
305+
'pineapple'
306+
);
307+
},
308+
180000
309+
);
310+
311+
it.skipIf(!canRun)(
312+
'deploy --plan completes successfully',
313+
async () => {
314+
const result = await run(['deploy', '--plan', '--json']);
315+
316+
expect(result.exitCode, `Deploy --plan failed: ${result.stderr}`).toBe(0);
317+
},
318+
120000
319+
);
264320
});
265321
}
266322

0 commit comments

Comments
 (0)