From 81acb74320bec2d38bcfa543f1300bfe75c8ba2c Mon Sep 17 00:00:00 2001 From: viccoder-oops Date: Sat, 29 Aug 2026 00:26:55 +0100 Subject: [PATCH] Add explicit retention and expiry test expectations --- src/expiry.rs | 5 ++++- src/retention.rs | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/expiry.rs b/src/expiry.rs index 2e25948..2af6123 100644 --- a/src/expiry.rs +++ b/src/expiry.rs @@ -167,7 +167,10 @@ mod tests { .unwrap(); assert_eq!(updated.status, "expired"); - let received = server.received_requests().await.unwrap(); + let received = server + .received_requests() + .await + .expect("mock server should record the first expiry webhook only"); assert_eq!(received.len(), 1, "exactly one webhook POST must be sent"); let req = &received[0]; assert_eq!( diff --git a/src/retention.rs b/src/retention.rs index 7b0a293..95a4d7d 100644 --- a/src/retention.rs +++ b/src/retention.rs @@ -159,7 +159,7 @@ mod tests { .max_connections(1) .connect("sqlite::memory:") .await - .unwrap(); + .expect("pruned delivery ids should load from sqlite"); db::migrate(&pool).await.unwrap(); Arc::new(AppState { pool, @@ -195,7 +195,7 @@ mod tests { .bind(format!("-{age_days} days")) .execute(&state.pool) .await - .unwrap(); + .expect("pending delivery count should load from sqlite"); } let (deliveries, _) = prune_once(&state).await.unwrap(); @@ -204,7 +204,7 @@ mod tests { let left: Vec = sqlx::query_scalar("SELECT id FROM webhook_deliveries ORDER BY id") .fetch_all(&state.pool) .await - .unwrap(); + .expect("backlog drain should leave no deliveries behind"); assert_eq!(left, vec!["new-delivered", "old-pending"]); }