Context
FastAPI / WebSocket code under farm/api/ is excluded from the coverage report in .coveragerc while the repo enforces a 90% gate on the simulation core.
This issue tracks API-layer test coverage (controllers, server wiring, CLI entrypoints that live under api).
Scope (paths)
farm/api/server.py
farm/api/simulation_controller.py
farm/api/experiment_controller.py
farm/api/analysis_controller.py
farm/api/cli.py
- (Examples under
farm/api/examples.py are already omitted at [run]; tests can still reference patterns from there.)
Suggested approach
- Use
httpx.AsyncClient + ASGITransport or Starlette/FastAPI TestClient against the ASGI app.
- Mock long-running simulation work where needed; keep tests deterministic.
- Cover WebSocket handlers with short-lived connections and mocked backends where practical.
Acceptance criteria
- Integration-style tests marked appropriately if they need DB or network fakes.
- Trim
.coveragerc [report] omit for files that reach stable coverage without breaking --cov-fail-under=90.
Context
FastAPI / WebSocket code under
farm/api/is excluded from the coverage report in.coveragercwhile the repo enforces a 90% gate on the simulation core.This issue tracks API-layer test coverage (controllers, server wiring, CLI entrypoints that live under
api).Scope (paths)
farm/api/server.pyfarm/api/simulation_controller.pyfarm/api/experiment_controller.pyfarm/api/analysis_controller.pyfarm/api/cli.pyfarm/api/examples.pyare already omitted at[run]; tests can still reference patterns from there.)Suggested approach
httpx.AsyncClient+ASGITransportor Starlette/FastAPITestClientagainst the ASGI app.Acceptance criteria
.coveragerc[report] omitfor files that reach stable coverage without breaking--cov-fail-under=90.