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
17 lines
573 B
Rust
17 lines
573 B
Rust
#[tokio::test]
|
|
async fn test_redis_cache() {
|
|
// dotenv().ok();
|
|
// let redis_url = std::env::var("REDIS_URL").unwrap_or_else(|_| "redis://127.0.0.1:6379".to_string());
|
|
// let cache = RedisCache::new(&redis_url);
|
|
//
|
|
// let key = &"test_key".to_string();
|
|
// let value = "test_value";
|
|
//
|
|
// // Test setting a value
|
|
// cache.set(key, &value, 10).await.unwrap();
|
|
//
|
|
// // Test getting the value
|
|
// let cached_value: Option<String> = cache.get(key).await.unwrap();
|
|
// assert_eq!(cached_value, Some("test_value".to_string()));
|
|
}
|