Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions e2e/perstack-cli/options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,23 +161,31 @@ describe.concurrent("CLI Options", () => {
})

describe.concurrent("CLI Options - Filter", () => {
/** Verifies --filter option with single type */
/** Verifies --filter option with single type.
* Retries up to 3 times because --filter completeRun only outputs the final
* event; when the LLM call errors the runtime emits stopRunByError (blocked
* by the filter) and exits 0 with zero events.
*/
it(
"should filter events to only completeRun",
async () => {
const cmdResult = await runCli(
[
"run",
"--config",
GLOBAL_RUNTIME_CONFIG,
"--filter",
"completeRun",
"e2e-global-runtime",
"Say hello",
],
{ timeout: LLM_TIMEOUT },
)
const result = withEventParsing(cmdResult)
const args = [
"run",
"--config",
GLOBAL_RUNTIME_CONFIG,
"--filter",
"completeRun",
"e2e-global-runtime",
"Say hello",
]
let result = withEventParsing(await runCli(args, { timeout: LLM_TIMEOUT }))
for (
let attempt = 1;
attempt < 3 && result.exitCode === 0 && result.events.length === 0;
attempt++
) {
result = withEventParsing(await runCli(args, { timeout: LLM_TIMEOUT }))
}
expect(result.exitCode).toBe(0)

// All events should be completeRun
Expand Down