From 1ee750addf2c15a35201538433ec56941950555e Mon Sep 17 00:00:00 2001 From: Hayt <211b96e6a2b7f45fd4047988976c7bbbeeda0c15f3ae7b32eec20834b5a55118@buzz.block.builderlab.xyz> Date: Fri, 25 Sep 2026 14:09:47 -0400 Subject: [PATCH] fix(ci): run the admin disabled-mode DB test in the PostgreSQL lane The test hits a DB fallthrough but was not #[ignore]d, so it only passed in the unit job by waiting out the sqlx acquire timeout, and the exclusions meant to skip it stopped matching after the move into mod postgres_tests. Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- Justfile | 19 ++++++------------- crates/buzz-relay/src/api/admin/mod.rs | 3 ++- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Justfile b/Justfile index f94527b4270..0e9f67a109a 100644 --- a/Justfile +++ b/Justfile @@ -444,18 +444,11 @@ test-unit: # and a red one could ship green (exactly how a broken admin test slipped # past every gate once). Scoped to api::admin, not the whole buzz-relay # --lib, because api::media has non-ignored tests that require Postgres. - # Two api::admin tests are excluded: both exercise a read-route DB - # fallthrough and pass without a database only by waiting out the sqlx - # acquire timeout (~30s each), so they do not belong in the infra-free - # unit job. nip98_mode_unrostered_signer_does_not_consume_a_replay_slot - # asserts a unique replay-guard invariant, so it is wired into the - # Postgres-backed Backend Integration job (see ci.yml "Admin API - # unrostered-signer replay invariant"). disabled_mode_allows_ - # unauthenticated_requests_on_the_admin_host has no unique invariant: - # disabled-mode unauthenticated success is covered by - # disabled_mode_regression_pin_unauthenticated_request_is_served on the - # DB-free /probe route, and its Host/Origin gating is covered here by - # disabled_mode_still_requires_the_correct_host / _a_matching_origin. + # DB-backed api::admin tests are #[ignore]d and run in the PostgreSQL + # lane; the non-ignored ones reject before touching the database. Any + # new non-ignored test here must stay DB-free: without a database, a + # DB fallthrough only "passes" by waiting out the ~30s sqlx acquire + # timeout. # The second clause adds the relay's pure authorization-decision tests: # the NIP-29 channel membership grid (handlers::channel_authz), the # moderation capability grid (handlers::moderation_authz), and the pure @@ -470,7 +463,7 @@ test-unit: # the ~30s sqlx acquire timeout, so they do not belong in the infra-free # unit job either. cargo nextest run -p buzz-relay --lib \ - -E '(test(/^api::admin::/) - test(=api::admin::tests::disabled_mode_allows_unauthenticated_requests_on_the_admin_host) - test(=api::admin::tests::nip98_mode_unrostered_signer_does_not_consume_a_replay_slot)) + test(/^handlers::channel_authz::/) + test(/^handlers::moderation_authz::/) + test(/^handlers::side_effects::tests::/) + test(/^storage_sweep::tests::/)' + -E 'test(/^api::admin::/) + test(/^handlers::channel_authz::/) + test(/^handlers::moderation_authz::/) + test(/^handlers::side_effects::tests::/) + test(/^storage_sweep::tests::/)' # ACP author-gate and queue tests protect the trust boundary between # relay events and agent prompts. They are infra-free; ignored lifecycle # tests remain excluded and run in their dedicated integration lanes. diff --git a/crates/buzz-relay/src/api/admin/mod.rs b/crates/buzz-relay/src/api/admin/mod.rs index e59591f7718..5ca74ec659d 100644 --- a/crates/buzz-relay/src/api/admin/mod.rs +++ b/crates/buzz-relay/src/api/admin/mod.rs @@ -1980,6 +1980,7 @@ mod postgres_tests { } #[tokio::test] + #[ignore = "requires PostgreSQL"] async fn disabled_mode_allows_unauthenticated_requests_on_the_admin_host() { let state = disabled_mode_state().await; for uri in read_routes() { @@ -1993,7 +1994,7 @@ mod postgres_tests { ) .await; // The routes return 200 (or 404 for unknown resources) — never 401. - // 404 is fine here: there is no real DB, so the row lookups fail. + // 404 is fine for unknown resources; the assertion is only that auth is skipped. assert_ne!( response.status(), StatusCode::UNAUTHORIZED,