mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-05 00:47:48 +08:00
refactor(workspace): enforce layered crate boundaries
This commit is contained in:
@@ -10,7 +10,7 @@ use aether_data::repository::provider_catalog::InMemoryProviderCatalogReadReposi
|
||||
use aether_data::repository::proxy_nodes::InMemoryProxyNodeRepository;
|
||||
use aether_data_contracts::repository::provider_catalog::ProviderCatalogReadRepository;
|
||||
use aether_runtime_state::{RedisClientConfig, RuntimeState};
|
||||
use aether_testkit::ManagedRedisServer;
|
||||
use aether_test_support::ManagedRedisServer;
|
||||
use axum::body::to_bytes;
|
||||
use axum::body::Body;
|
||||
use axum::routing::{any, get, post};
|
||||
|
||||
@@ -1009,6 +1009,26 @@ async fn gateway_handles_admin_stats_provider_performance_locally_with_trusted_a
|
||||
payload["timeline"][1]["avg_first_byte_time_ms"],
|
||||
serde_json::Value::Null
|
||||
);
|
||||
|
||||
let without_timeline_response = admin_request(reqwest::Client::new().get(format!(
|
||||
"{gateway_url}/api/admin/stats/performance/providers?start_date=2024-03-21&end_date=2024-03-21&granularity=hour&limit=2&tz_offset_minutes=0&include_timeline=false"
|
||||
)))
|
||||
.send()
|
||||
.await
|
||||
.expect("request without timeline should succeed");
|
||||
assert_eq!(without_timeline_response.status(), StatusCode::OK);
|
||||
let without_timeline_payload: serde_json::Value = without_timeline_response
|
||||
.json()
|
||||
.await
|
||||
.expect("json body without timeline should parse");
|
||||
assert_eq!(without_timeline_payload["summary"], payload["summary"]);
|
||||
assert_eq!(without_timeline_payload["providers"], payload["providers"]);
|
||||
assert_eq!(
|
||||
without_timeline_payload["timeline"]
|
||||
.as_array()
|
||||
.map(Vec::len),
|
||||
Some(0)
|
||||
);
|
||||
assert_eq!(*upstream_hits.lock().expect("mutex should lock"), 0);
|
||||
|
||||
gateway_handle.abort();
|
||||
|
||||
Reference in New Issue
Block a user