CodeVetter · Repo Unpack · Testing signals
tokio-rs/axum
Tests and CI were inspected, not executed; test existence is not evidence of a passing result. The inspected suite combines Tokio runtime tests, direct Tower service calls, real HTTP/WebSocket clients, and nightly compile-time fixtures. Assertions cover several important protocol and rejection behaviors, while individual example tests have narrower scopes. This is a bounded assessment without measured coverage or live integration verification.
- CI declares stable/beta locked all-feature, all-target tests for both workspaces, a separate nightly macro job, and Rust 1.80 tests after minimal-version dependency selection; these configurations were read, not run.
- The internal #[crate::test] helper expands to #[tokio::test] and generates an additional nest_service variant when a test contains matching nest calls; TestClient launches an ephemeral localhost server and uses reqwest with redirects disabled.
- Routing tests assert inherited versus overridden nested fallbacks; HEAD tests use Router::oneshot directly and assert preserved headers with an empty response body for handlers and services.
- Json tests assert successful deserialization, 415 without JSON content type, accepted +json media types, 400 for syntax/trailing-data errors, and 422 with a field path for invalid typed data.
- Server tests use paused Tokio time and duplex IO to assert stalled-header closure; graceful_shutdown_completes_inflight_request holds a handler open, signals shutdown, then checks that its response completes before the server resolves.
- Macro UI tests use trybuild pass/fail fixtures only on nightly, become a no-op on other toolchains, and accept AXUM_TEST_ONLY; inspected failures exercise wrong extractor order and a non-Send future.
- The WebSocket example tests one text echo through a real tokio-tungstenite connection and through mocked Sink/Stream channels; the SSE example integration test takes one event and asserts its data is hi!.
- Form tests check GET markup and one POST response; validator tests check missing, empty, short, and valid names; the inspected static-file test checks one root-path fallback returning index HTML with 404, rather than every service variant.