Skip to content

Commit b1e4576

Browse files
committed
test: add comprehensive Tower integration tests
Add extensive test coverage for Tower service integration: - Basic Tower service tests for both Cloud and Enterprise clients - All HTTP methods (GET, POST, PUT, PATCH, DELETE) - Oneshot and multiple request patterns - Error handling and validation - Tower middleware composition tests - Timeout middleware with configurable durations - Rate limiting with token bucket - Buffer layer for concurrent request handling - Custom middleware for request counting - Full middleware stack composition - Add tower dev dependency for middleware features - Re-export tower_support module from lib.rs when tower-integration feature enabled Tests demonstrate CloudClient and EnterpriseClient work correctly with Tower's middleware ecosystem for production patterns like timeouts, rate limiting, and buffering.
1 parent a31d13b commit b1e4576

File tree

9 files changed

+1810
-71
lines changed

9 files changed

+1810
-71
lines changed

Cargo.lock

Lines changed: 14 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/redis-cloud/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ wiremock = { workspace = true }
3838
tokio = { workspace = true, features = ["rt", "macros", "test-util"] }
3939
pretty_assertions = { workspace = true }
4040
serial_test = { workspace = true }
41+
tower = { version = "0.5", features = ["timeout", "limit", "retry", "buffer"] }

crates/redis-cloud/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ mod lib_tests;
284284
// Re-export client types
285285
pub use client::{CloudClient, CloudClientBuilder};
286286

287+
// Re-export Tower integration when feature is enabled
288+
#[cfg(feature = "tower-integration")]
289+
pub use client::tower_support;
290+
287291
// Types module for shared models
288292
pub mod types;
289293

0 commit comments

Comments
 (0)