diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-11 16:53:03 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-11 16:53:03 +0000 |
| commit | 2a9160836bb87fdea3ae891563b0169c68d1c2ab (patch) | |
| tree | 583c890687beaf7f380fc0be131bdf17485f06fa /tests/sync/metrics.rs | |
| parent | 52489d3b1a7d79e164b4cc901b53fd06c05ce1b1 (diff) | |
fix: resolve all fmt and clippy warnings
Main lib (src/):
- Add #[allow(dead_code)] for build_info field (stored to prevent Prometheus unregistration)
- Add #[allow(dead_code)] for first_seen field (reserved for future rate limiting)
- Replace .or_insert_with(RelaySyncNeeds::default) with .or_default()
- Replace manual div_ceil implementations with .div_ceil(100)
Test code (tests/):
- Replace .expect(&format!(...)) with .unwrap_or_else(|_| panic!(...))
- Remove needless borrows in fetch_metrics() calls
- Add #[allow(dead_code)] and #[allow(unused_imports)] to test helpers module
grasp-audit:
- Apply cargo fmt to fix formatting
Diffstat (limited to 'tests/sync/metrics.rs')
| -rw-r--r-- | tests/sync/metrics.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/sync/metrics.rs b/tests/sync/metrics.rs index 26d379d..14e1dfd 100644 --- a/tests/sync/metrics.rs +++ b/tests/sync/metrics.rs | |||
| @@ -32,7 +32,7 @@ async fn test_prometheus_format_valid() { | |||
| 32 | let relay = TestRelay::start().await; | 32 | let relay = TestRelay::start().await; |
| 33 | tokio::time::sleep(Duration::from_millis(500)).await; | 33 | tokio::time::sleep(Duration::from_millis(500)).await; |
| 34 | 34 | ||
| 35 | let metrics = fetch_metrics(&relay.url()) | 35 | let metrics = fetch_metrics(relay.url()) |
| 36 | .await | 36 | .await |
| 37 | .expect("Failed to fetch metrics"); | 37 | .expect("Failed to fetch metrics"); |
| 38 | 38 | ||
| @@ -67,7 +67,7 @@ async fn test_metrics_availability_during_sync() { | |||
| 67 | 67 | ||
| 68 | // Make multiple metrics requests while sync is active | 68 | // Make multiple metrics requests while sync is active |
| 69 | for i in 0..3 { | 69 | for i in 0..3 { |
| 70 | let metrics = fetch_metrics(&sync_relay.url()).await; | 70 | let metrics = fetch_metrics(sync_relay.url()).await; |
| 71 | assert!( | 71 | assert!( |
| 72 | metrics.is_ok(), | 72 | metrics.is_ok(), |
| 73 | "Metrics request {} should succeed during sync", | 73 | "Metrics request {} should succeed during sync", |
| @@ -135,7 +135,7 @@ async fn test_metric_values_are_numeric() { | |||
| 135 | let relay = TestRelay::start().await; | 135 | let relay = TestRelay::start().await; |
| 136 | tokio::time::sleep(Duration::from_millis(500)).await; | 136 | tokio::time::sleep(Duration::from_millis(500)).await; |
| 137 | 137 | ||
| 138 | let metrics = fetch_metrics(&relay.url()) | 138 | let metrics = fetch_metrics(relay.url()) |
| 139 | .await | 139 | .await |
| 140 | .expect("Should fetch metrics"); | 140 | .expect("Should fetch metrics"); |
| 141 | 141 | ||