Skip to content

Commit c7d3bd3

Browse files
committed
fix: change Tower integration doctests to ignore attribute
The doctests for tower_support module were failing in CI because the tower-integration feature isn't enabled during doc tests. Changed from no_run to ignore attribute since these are example code showing feature usage rather than runnable tests. This allows the examples to serve as documentation without requiring the feature to be enabled during testing.
1 parent 4f116f8 commit c7d3bd3

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

crates/redis-cloud/src/client.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -376,16 +376,12 @@ impl CloudClient {
376376
///
377377
/// # Examples
378378
///
379-
/// ```rust,no_run
379+
/// ```rust,ignore
380380
/// use redis_cloud::CloudClient;
381-
/// # #[cfg(feature = "tower-integration")]
382381
/// use redis_cloud::tower_support::ApiRequest;
383-
/// # #[cfg(feature = "tower-integration")]
384382
/// use tower::ServiceExt;
385383
///
386384
/// # async fn example() -> Result<(), Box<dyn std::error::Error>> {
387-
/// # #[cfg(feature = "tower-integration")]
388-
/// # {
389385
/// let client = CloudClient::builder()
390386
/// .api_key("your-key")
391387
/// .api_secret("your-secret")
@@ -397,7 +393,6 @@ impl CloudClient {
397393
/// // Use the service
398394
/// let response = service.oneshot(ApiRequest::get("/subscriptions")).await?;
399395
/// println!("Status: {}", response.status);
400-
/// # }
401396
/// # Ok(())
402397
/// # }
403398
/// ```
@@ -504,24 +499,19 @@ pub mod tower_support {
504499
///
505500
/// # Examples
506501
///
507-
/// ```rust,no_run
502+
/// ```rust,ignore
508503
/// use redis_cloud::CloudClient;
509-
/// # #[cfg(feature = "tower-integration")]
510504
/// use tower::ServiceExt;
511-
/// # #[cfg(feature = "tower-integration")]
512505
/// use redis_cloud::tower_support::ApiRequest;
513506
///
514507
/// # async fn example() -> Result<(), Box<dyn std::error::Error>> {
515-
/// # #[cfg(feature = "tower-integration")]
516-
/// # {
517508
/// let client = CloudClient::builder()
518509
/// .api_key("key")
519510
/// .api_secret("secret")
520511
/// .build()?;
521512
///
522513
/// let mut service = client.into_service();
523514
/// let response = service.oneshot(ApiRequest::get("/subscriptions")).await?;
524-
/// # }
525515
/// # Ok(())
526516
/// # }
527517
/// ```

crates/redis-enterprise/src/client.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -575,16 +575,12 @@ impl EnterpriseClient {
575575
///
576576
/// # Examples
577577
///
578-
/// ```rust,no_run
578+
/// ```rust,ignore
579579
/// use redis_enterprise::EnterpriseClient;
580-
/// # #[cfg(feature = "tower-integration")]
581580
/// use redis_enterprise::tower_support::ApiRequest;
582-
/// # #[cfg(feature = "tower-integration")]
583581
/// use tower::ServiceExt;
584582
///
585583
/// # async fn example() -> Result<(), Box<dyn std::error::Error>> {
586-
/// # #[cfg(feature = "tower-integration")]
587-
/// # {
588584
/// let client = EnterpriseClient::builder()
589585
/// .base_url("https://localhost:9443")
590586
/// .username("admin")
@@ -598,7 +594,6 @@ impl EnterpriseClient {
598594
/// // Use the service
599595
/// let response = service.oneshot(ApiRequest::get("/v1/cluster")).await?;
600596
/// println!("Status: {}", response.status);
601-
/// # }
602597
/// # Ok(())
603598
/// # }
604599
/// ```
@@ -705,16 +700,12 @@ pub mod tower_support {
705700
///
706701
/// # Examples
707702
///
708-
/// ```rust,no_run
703+
/// ```rust,ignore
709704
/// use redis_enterprise::EnterpriseClient;
710-
/// # #[cfg(feature = "tower-integration")]
711705
/// use tower::ServiceExt;
712-
/// # #[cfg(feature = "tower-integration")]
713706
/// use redis_enterprise::tower_support::ApiRequest;
714707
///
715708
/// # async fn example() -> Result<(), Box<dyn std::error::Error>> {
716-
/// # #[cfg(feature = "tower-integration")]
717-
/// # {
718709
/// let client = EnterpriseClient::builder()
719710
/// .base_url("https://localhost:9443")
720711
/// .username("admin")
@@ -724,7 +715,6 @@ pub mod tower_support {
724715
///
725716
/// let mut service = client.into_service();
726717
/// let response = service.oneshot(ApiRequest::get("/v1/cluster")).await?;
727-
/// # }
728718
/// # Ok(())
729719
/// # }
730720
/// ```

0 commit comments

Comments
 (0)