Summary
crates/buzz-relay/src/api/admin/mod.rs has two PG-dependent integration tests in mod tests that fail hard when run without a live Postgres, mirroring the exact problem tracked in #4080 for api::media::tests:
admin::tests::report_detail_rejects_unknown_report — calls test_state() (which eagerly seeds a community via ensure_configured_community, panicking if BUZZ_DATABASE_URL is unset), then asserts a 404 for /reports/{nil-uuid} on the admin host.
admin::tests::feedback_attachment_rejects_unknown_feedback — same shape, asserts 404 for /feedback/{nil-uuid}/attachments/{hash}.
Both currently fail with a 500 (from a dead PoolTimedOut / connect error surfaced as S3Error-style 500, not the application-level ApiError::not_found) whenever cargo test -p buzz-relay runs in an environment where BUZZ_TEST_DATABASE_URL is not pointing at a live Postgres.
Sibling tests in the same module that assert 403 (admin-host gate, before any DB access) continue to pass — these two are the only ones post-authorize DB call.
Proposed fix
Apply the same #[ignore = "requires a live Postgres: set BUZZ_TEST_DATABASE_URL"] attribute pattern used in crates/buzz-search/tests/fts_integration.rs and already applied to api::media::tests for #4080. Then cargo test -p buzz-relay passes cleanly in PG-less environments and developers opt back into the live-Postgres surface with:
BUZZ_TEST_DATABASE_URL=postgres://buzz:buzz_dev@localhost:5432/buzz \
cargo test -p buzz-relay -- --include-ignored
Follow-up (out of scope)
Refactoring test_state() to stop eagerly seeding a community (the same DX problem called out in #4080) would let even more admin tests run without PG.
Summary
crates/buzz-relay/src/api/admin/mod.rshas two PG-dependent integration tests inmod teststhat fail hard when run without a live Postgres, mirroring the exact problem tracked in #4080 forapi::media::tests:admin::tests::report_detail_rejects_unknown_report— callstest_state()(which eagerly seeds a community viaensure_configured_community, panicking ifBUZZ_DATABASE_URLis unset), then asserts a 404 for/reports/{nil-uuid}on the admin host.admin::tests::feedback_attachment_rejects_unknown_feedback— same shape, asserts 404 for/feedback/{nil-uuid}/attachments/{hash}.Both currently fail with a 500 (from a dead
PoolTimedOut/ connect error surfaced asS3Error-style 500, not the application-levelApiError::not_found) whenevercargo test -p buzz-relayruns in an environment whereBUZZ_TEST_DATABASE_URLis not pointing at a live Postgres.Sibling tests in the same module that assert 403 (admin-host gate, before any DB access) continue to pass — these two are the only ones post-
authorizeDB call.Proposed fix
Apply the same
#[ignore = "requires a live Postgres: set BUZZ_TEST_DATABASE_URL"]attribute pattern used incrates/buzz-search/tests/fts_integration.rsand already applied toapi::media::testsfor #4080. Thencargo test -p buzz-relaypasses cleanly in PG-less environments and developers opt back into the live-Postgres surface with:BUZZ_TEST_DATABASE_URL=postgres://buzz:buzz_dev@localhost:5432/buzz \ cargo test -p buzz-relay -- --include-ignoredFollow-up (out of scope)
Refactoring
test_state()to stop eagerly seeding a community (the same DX problem called out in #4080) would let even more admin tests run without PG.