test: add missing httpapi coverage scenarios for 38 routes - #203
Merged
Merged
Conversation
Closes #187 Adds exercise scenarios for the 38 routes that had none, across agentui, batuta, combo, mcp, memory, config, experimental (background-job), external-agent, and telegram route groups — `bun run test:httpapi` was failing on `--fail-on-missing` even though every real unit test passed, masking actual signal on unit (linux)/ unit (windows) CI. Adds `seedPost`/`rawRequest` helpers (backend.ts, runner.ts, types.ts) so seed steps can create AgentUI/Batuta/Combo config-overlay state through the real in-process HTTP route rather than poking a service directly — those services live only behind the full HttpApiApp, not the plain AppLayer the other seed helpers run against. Batuta scenarios were written to respect this repo's documented module invariants (CLAUDE.md): detection/skill-install always target the connected server never the desktop client, detection never spawns `which`/`where` subprocesses, and combobox-enablement is gated on skill-installed state separately from raw detection status. Verified: all three exercise modes (coverage/auth/effect) report missing=0. Coverage and auth modes are fully green (245 pass, 0 fail). Effect mode has 6 pre-existing failures unrelated to this change (pty.create, worktree.reset, v2.pty.create, session.prompt, session.prompt_async, session.command — confirmed present before this PR's scenarios were added, caused by unrelated LLM/PTY backend issues in effect mode) — out of scope here and worth tracking separately. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #187
Type of change
What does this PR do?
bun run test:httpapi(threehttpapi-exercise.tsmodes: coverage/auth/effect, each run with--fail-on-missing --fail-on-skip) was failing because 38 routes had no exercise scenario, across theagentui,batuta,combo,mcp,memory,config(globalPath),experimental(background-job),external-agent, andtelegramroute groups. This madeunit (linux)/unit (windows)CI report red even though every actual unit test passed, masking real signal.Added a real scenario for each missing route, following the existing DSL conventions (
http.protected.get/post/...,.seeded(...),.at(...),.json(...)/.jsonEffect(...),.mutating()). AddedseedPost/rawRequesthelpers (backend.ts,runner.ts,types.ts) so seed steps can create AgentUI/Batuta/Combo config-overlay state through the real in-process HTTP route rather than poking a service directly — those services only live behind the fullHttpApiApp, not the plainAppLayerthe other seed helpers run against.Batuta scenarios were written to respect this repo's documented module invariants (CLAUDE.md): detection/skill-install always target the connected server, never the desktop client; detection never spawns
which/wheresubprocesses; combobox-enablement is gated on skill-installed state separately from raw detection status.Also found and fixed one bug introduced by the new
combo.resolvescenario itself: it needed.withLlm()to register the faketest/test-modelprovider — without it,Combo.resolvecorrectly returnedComboExhaustedErrorsince no provider/model could resolve. Fixed by adding.withLlm(), verified in isolation with--include combo.resolve.Note: effect mode has 6 pre-existing failures unrelated to this change —
pty.create,worktree.reset,v2.pty.create,session.prompt,session.prompt_async,session.command. Confirmed present before any of this PR's scenarios were added (stashed this PR's diff and reran — same failures, same error messages: PTY spawn 500s, a worktree-not-found 400, and fake-LLM text/timeout mismatches). Out of scope for #187 (which is specifically about missing scenarios, not these pre-existing broken ones) — worth tracking as a separate issue.How did you verify your code works?
bun run script/httpapi-exercise.ts --mode coverage --fail-on-missing --fail-on-skip→ 245 pass, 0 fail, 0 missingbun run script/httpapi-exercise.ts --mode auth --fail-on-missing --fail-on-skip→ 245 pass, 0 fail, 0 missingbun run script/httpapi-exercise.ts --mode effect --fail-on-missing --fail-on-skip→ 239 pass, 6 fail (all pre-existing, unrelated — see above), 0 missingbun turbo typecheck→ all 30 packages pass (also ran automatically on push via hook)Screenshots / recordings
N/A (test-only change, no UI impact).
Checklist
🤖 Generated with Claude Code