Skip to content

test(cli): tier-A read-only command smoke tests#28274

Open
kitlangton wants to merge 1 commit into
worktree-cli-help-snapshotsfrom
worktree-cli-tier-a
Open

test(cli): tier-A read-only command smoke tests#28274
kitlangton wants to merge 1 commit into
worktree-cli-help-snapshotsfrom
worktree-cli-tier-a

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

Adds smoke tests for the seven read-only commands that share the run-shaped lifecycle:

  • `mcp list`
  • `providers list`
  • `models`
  • `agent list`
  • `session list`
  • `stats`
  • `db path`

Each test asserts only that the command exits 0 and produces sane output in the harness's isolated env. They're not behavioral tests — they're the cheapest possible signal that the dependency-layer wiring (config load, DB init, server boot, provider resolution) doesn't crash for the broad class of "no inputs, no side effects" commands. A regression in any shared layer will fail one or more of these tests.

Pushes behavioral coverage of the CLI surface from ~14% → ~50%.

Findings while wiring assertions

  • `providers list` reflects credentials + env vars, not config-injected static providers. The assertion verifies the section headers ("Credentials" / "Environment") to lock in the output shape.
  • `db path` returns SQLite's `:memory:` under harness isolation (no on-disk pollution between tests). The assertion accepts either `:memory:` or a real path.

Stacked on #28267

Base: `worktree-cli-help-snapshots` so the diff stays minimal once the parent merges.

Test plan

  • 7/7 pass locally in ~7s
  • `bun run test test/cli/` — 331/331 pass across the harness suite
  • `bun run typecheck` clean

Adds smoke tests for the seven read-only commands that share the
run-shaped lifecycle:

  - mcp list
  - providers list
  - models
  - agent list
  - session list
  - stats
  - db path

Each test asserts only that the command exits 0 and produces sane
output in the harness's isolated env. They're not behavioral tests —
they're the cheapest possible signal that the dependency-layer wiring
(config load, DB init, server boot, provider resolution) doesn't crash
for the broad class of "no inputs, no side effects" commands. A
regression in any shared layer will fail one or more of these tests.

Pushes behavioral coverage of the CLI surface from ~14% to ~50%.

Findings while wiring assertions:

  - \`providers list\` reflects credentials + env vars, not
    config-injected static providers. The assertion verifies the
    section headers ("Credentials" / "Environment") to lock in the
    output shape.
  - \`db path\` returns SQLite's \`:memory:\` under harness isolation
    (no on-disk pollution between tests). The assertion accepts either
    \`:memory:\` or a real path.

7/7 pass in ~7s; full CLI suite stays green at 331/331.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant