refactor: rename api_gateway → api across workspace, tests, and load crate

- Workspace Cargo.toml: remove web-gateway + api_gateway members, keep api
- trading_service: dep api-gateway → api, update test imports
- testing/api-gateway-load → testing/api-load (crate renamed)
- All test crates: get_api_gateway_addr → get_api_addr + variable renames

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-03-04 23:38:21 +01:00
parent e50ea55064
commit d25c82f8f3
31 changed files with 74 additions and 75 deletions

View File

@@ -68,7 +68,7 @@ pub mod common {
}
/// Load API Gateway URL from environment
pub fn api_gateway_url() -> String {
pub fn api_url() -> String {
std::env::var("API_GATEWAY_URL")
.unwrap_or_else(|_| "http://localhost:50051".to_string())
}

View File

@@ -46,9 +46,9 @@ async fn test_trading_service_health() {
}
#[tokio::test]
async fn test_api_gateway_health() {
async fn test_api_health() {
let result = with_timeout(async {
let url = api_gateway_url();
let url = api_url();
println!("Testing API Gateway at {}", url);
// Try gRPC connection
@@ -66,7 +66,7 @@ async fn test_api_gateway_health() {
}
}).await;
skip_if_unavailable!("API Gateway", { result });
skip_if_unavailable!("API", { result });
}
#[tokio::test]
@@ -122,7 +122,7 @@ async fn test_service_ports_listening() {
println!("🔍 Checking service ports...");
let ports_to_check = vec![
(50051, "API Gateway"), // Primary entry point
(50051, "API"), // Primary entry point
(50052, "Trading Service"), // Backend service
(50053, "Backtesting Service"),
(50054, "ML Training Service"),
@@ -159,7 +159,7 @@ async fn test_service_response_times() {
let services = vec![
(trading_service_url(), "Trading Service"),
(api_gateway_url(), "API Gateway"),
(api_url(), "API"),
];
for (url, name) in services {
@@ -197,7 +197,7 @@ async fn test_metrics_endpoints() {
let client = reqwest::Client::new();
let metrics_ports = vec![
(9091, "API Gateway"),
(9091, "API"),
(9092, "Trading Service"),
(9093, "Backtesting Service"),
(9094, "ML Training Service"),

View File

@@ -1,6 +1,6 @@
/// Watch tuning progress with live updates (poll every 5 seconds)
async fn watch_tuning_progress(
api_gateway_url: &str,
api_url: &str,
jwt_token: &str,
job_id: &str,
) -> AnyhowResult<()> {
@@ -14,7 +14,7 @@ async fn watch_tuning_progress(
.context("❌ Invalid job ID format (expected UUID)")?;
// Create gRPC client once (reuse connection)
let mut client = MlTrainingServiceClient::connect(api_gateway_url.to_string())
let mut client = MlTrainingServiceClient::connect(api_url.to_string())
.await
.context("Failed to connect to API Gateway")?;