fabro/lib/crates/fabro-server/tests/it/api
Bryan Helmkamp 83a21e5d37
test(server): Run Files HTTP integration suite (P2-9)
Adds lib/crates/fabro-server/tests/it/api/run_files.rs covering the
HTTP-level plumbing branches of GET /api/v1/runs/{id}/files:

- Invalid run_id path returns 400
- Unknown run returns 404 (IDOR-safe; same status as missing-run case)
- Malformed from_sha / to_sha query params return 400 before any work
- Non-default from_sha value returns 400 even when hex-well-formed
  (v1 reserves the parameter for a future version)
- Submitted run with no sandbox record returns empty envelope
- Demo mode (X-Fabro-Demo: 1) returns the 3-entry fixture without
  touching the run store, with at least one populated-content entry
- Response envelope shape matches PaginatedRunFileList contract:
  data: FileDiff[], meta: { truncated, total_changed, ... } with
  correct field types

Sandbox-path happy case (live diff) and degraded-fallback scenarios
stay covered by unit tests on stitch_file_diff, build_fallback_response,
and the sandbox_git helpers, since integration-level scheduler setup
for terminal-run tests is flaky without broader harness scaffolding.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 17:40:14 -04:00
..
docs.rs fix(server): address TLS removal review follow-ups 2026-04-19 10:48:42 -04:00
install.rs refactor(install): tag GithubAppOwner with discriminated object shape 2026-04-19 13:48:31 -04:00
install_openai_compatible.rs refactor(install): return spec-conformant ApiError shape 2026-04-19 13:43:57 -04:00
mod.rs test(server): Run Files HTTP integration suite (P2-9) 2026-04-19 17:40:14 -04:00
routing.rs feat(install): add browser-based setup flow 2026-04-19 11:20:58 -04:00
run_files.rs test(server): Run Files HTTP integration suite (P2-9) 2026-04-19 17:40:14 -04:00
runs.rs refactor(server): remove inbound TLS termination 2026-04-19 10:43:57 -04:00
settings.rs refactor(server): remove inbound TLS termination 2026-04-19 10:43:57 -04:00
system.rs refactor(api): move features flags from /auth/me to /system/info 2026-04-15 08:51:22 -04:00
tcp.rs refactor(server): dedupe tcp test helpers and drop narrative comment 2026-04-19 11:04:45 -04:00