Repository navigation
Description
Problem
testsprite testlist run <list-id> exits 0 when the list holds zero test cases. With --wait it prints "Test-list run complete: 0/0 passed" and still exits 0. The response even says why (reason: "empty_list"), and the client treats it as success anyway.
Every other zero-dispatch path in the CLI is deliberately red:
test run --allwhen the resolved test set is empty (empty project, or a--filterthat matched nothing): exit 5 — the refusal names the doctrine: "A CI gate that passes on zero tests is unsafe; pass --allow-empty to exit 0 intentionally."test rerun --all: same--allow-emptygate.testlist run --case <id>where none of the ids belong to the list: exit 4 (refused).
The documented CI recipe points people at a list exactly when they want a mixed FE/BE gate (DOCUMENTATION.md, "Full frontend coverage: use a test list"):
testsprite testlist run tl_xxxxxxxx --wait \
--report junit --report-file testsprite-junit.xmlIf that list is empty — cases removed, scope migrated, an upstream seed step failed — the gate goes green after running zero tests. That is the false-green the exit-code table warns about: "exit 5 … This is deliberate — a gate that greens on zero tests is worse than no gate."
Reproduction
Empty list (0 cases):
$ testsprite testlist run 984010c8-8d3a-4865-bdb8-fea141005e62 --output json
{"accepted":[],"conflicts":[],"deferred":[],"reason":"empty_list"}
$ echo $?
0
$ testsprite testlist run 984010c8-8d3a-4865-bdb8-fea141005e62 --wait --output json
Test-list run complete: 0/0 passed, 0 failed/blocked, 0 timed out
{"accepted":[],"conflicts":[],"deferred":[],"reason":"empty_list","summary":{"passed":0,"failed":0,"timedOut":0,"deferred":0,"conflicts":0,"total":0}}
$ echo $?
0Contrast, same CLI, same account, same minute:
$ testsprite test run --all --project 1c57516c-b884-46a5-a957-8c35e9b96f60 --filter zzz-no-match-xyz
--filter: skipped 1 test whose name does not contain "zzz-no-match-xyz".
No tests found in project 1c57516c-… matching --filter "zzz-no-match-xyz" — nothing to run.
$ echo $?
5
$ testsprite testlist run 984010c8-… --case 00000000-0000-0000-0000-000000000000
Error: None of the requested case ids belong to this test list: 00000000-….
$ echo $?
4Where it comes from
runTestlistRun keeps the zero-work path flowing into the report tail by design (src/commands/testlist.ts, around line 648):
An empty/no-match run (zero accepted, zero conflicts) is NOT short-circuited: it flows through the fan-out (a no-op) and the report tail so an explicitly-requested --report junit still emits an empty-suite report rather than nothing.
The wire type splits the two shapes — reason?: 'no_matching_cases' | 'empty_list' (src/lib/testlist.types.ts:77) — and testlist run has no --allow-empty flag.
Suggested fix
Mirror the batch doctrine:
- When the server reports
reason: 'empty_list'(the list itself has nothing), emit the CI artifacts the same wayfinishZeroDispatchBatchdoes (summary, annotations, JUnit), then exit 5 with a message pointing at the opt-in. - Add
--allow-emptytotestlist runfor callers who deliberately gate on a list that is temporarily empty. - Stop the
--waitpath from ending on a cheerful "0/0 passed".
no_matching_cases can keep its current behavior or share the flag; the empty-list case is the one that can turn a CI job green with nothing executed.
Discord: okey_amy
Activity
OkeyAmy commentedon Oct 16, 2026
/assign
testsprite-hob commentedon Oct 16, 2026
Thanks for the interest, @OkeyAmy! This issue hasn't been accepted for implementation yet — see the triage comment (a maintainer will label it
acceptedonce it is). Feel free to check back, or ping us on Discord if it's been quiet.zeshi-du commentedon Oct 20, 2026
Thanks @OkeyAmy, you're right that
testlist runexits 0 on an empty list while the other zero-dispatch paths exit 5. That exit 0 is documented and existing tests rely on it, so changing it in a 0.x release would silently break CI scripts.In 1.0, an empty test list will exit 5, with
--allow-emptyfor the current behaviour. The same release will make a partly refused--waitbatch fail the gate, as discussed in #380.Tracked internally as DEV-2180. This stays open to track the change, but it isn't open for a community PR since it lands with the other 1.0 exit-code changes.
zeshi-du commentedon Nov 24, 2026
We're fixing this internally: an empty saved list will exit 5 on
run --testlist, with--allow-emptyfor the cases where an empty run is expected. It will ship in an upcoming release, so I'm closing this issue. Thanks @OkeyAmy for the report.