-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Context
PR #281 introduced monitoring integration tests that validate the /metrics (Prometheus) and /api/v1/health endpoints. A reviewer noted that the JSON REST API endpoints are only covered by unit tests in http_server.rs but lack integration-level validation against a running topology.
Goal
Extend test coverage to exercise the full JSON REST API surface in both unit tests and integration tests, ensuring the responses contain correct, meaningful data from live SV2 topologies.
Endpoints needing integration tests
All JSON API endpoints (/, /api/v1/global, /api/v1/server, /api/v1/server/channels, /api/v1/clients, /api/v1/clients/{id}, /api/v1/clients/{id}/channels, /api/v1/sv1/clients, /api/v1/sv1/clients/{id}) currently have unit tests only. /api/v1/health and /metrics are already covered by integration tests.
Suggested approach
- Add integration tests to
monitoring_integration.rsthat reuse existing topology setups and make HTTP requests to each JSON endpoint, asserting on status codes and key fields. - Add assertion helpers to
prometheus_metrics_assertions.rsfor JSON API responses. - Strengthen unit tests in
http_server.rsto cover edge cases (pagination boundaries, invalid path params, partial data sources).
Acceptance criteria
- Every JSON API endpoint has at least one integration test against a live topology
- Unit tests cover error/edge cases for pagination and missing data
- All existing tests continue to pass
cargo fmt,cargo clippy -D warningsclean
Metadata
Metadata
Assignees
Type
Projects
Status
Status