Add comprehensive documentation and unit tests
Documentation: - Add detailed README files for all services (auth, character, database, launcher, packet, utils, world) - Create API documentation for the database service with detailed endpoint specifications - Document database schema and relationships - Add service architecture overviews and configuration instructions Unit Tests: - Implement comprehensive test suite for database repositories (user, character, session) - Add gRPC service tests for database interactions - Create tests for packet service components (bufferpool, connection, packets) - Add utility service tests (health check, logging, load balancer, redis cache, service discovery) - Implement auth service user tests - Add character service tests Code Structure: - Reorganize test files into a more consistent structure - Create a dedicated tests crate for integration testing - Add test helpers and mock implementations for easier testing
This commit is contained in:
@@ -21,8 +21,8 @@ use tokio::{select, signal};
|
||||
use tracing::Level;
|
||||
use tracing::{debug, error, info, warn};
|
||||
use tracing_subscriber::EnvFilter;
|
||||
use utils::service_discovery::get_kube_service_endpoints_by_dns;
|
||||
use utils::{health_check, logging};
|
||||
use utils::service_discovery::{get_kube_service_endpoints_by_dns};
|
||||
use warp::Filter;
|
||||
|
||||
mod auth_client;
|
||||
@@ -66,8 +66,20 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let addr = env::var("LISTEN_ADDR").unwrap_or_else(|_| "0.0.0.0".to_string());
|
||||
let port = env::var("SERVICE_PORT").unwrap_or_else(|_| "29000".to_string());
|
||||
let metrics_port = env::var("PACKET_METRICS_PORT").unwrap_or_else(|_| "4001".to_string());
|
||||
let auth_url = format!("http://{}",get_kube_service_endpoints_by_dns("auth-service","tcp","auth-service").await?.get(0).unwrap());
|
||||
let character_url = format!("http://{}",get_kube_service_endpoints_by_dns("character-service","tcp","character-service").await?.get(0).unwrap());
|
||||
let auth_url = format!(
|
||||
"http://{}",
|
||||
get_kube_service_endpoints_by_dns("auth-service", "tcp", "auth-service")
|
||||
.await?
|
||||
.get(0)
|
||||
.unwrap()
|
||||
);
|
||||
let character_url = format!(
|
||||
"http://{}",
|
||||
get_kube_service_endpoints_by_dns("character-service", "tcp", "character-service")
|
||||
.await?
|
||||
.get(0)
|
||||
.unwrap()
|
||||
);
|
||||
|
||||
// Start health-check endpoint
|
||||
health_check::start_health_check(addr.as_str()).await?;
|
||||
@@ -109,9 +121,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
{
|
||||
error!("Error handling connection: {}", e);
|
||||
}
|
||||
packet_router
|
||||
.connection_service
|
||||
.remove_connection(&connection_id);
|
||||
packet_router.connection_service.remove_connection(&connection_id);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user