fabro/lib/crates/fabro-server
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
..
src test(server): tracing allowlist + coalescer cancellation (P2-11, P2-13) 2026-04-19 17:37:44 -04:00
tests/it test(server): Run Files HTTP integration suite (P2-9) 2026-04-19 17:40:14 -04:00
build.rs feat(cli): surface debug build profile in version output 2026-04-18 09:44:54 -04:00
Cargo.toml test(server): tracing allowlist + coalescer cancellation (P2-11, P2-13) 2026-04-19 17:37:44 -04:00