Overview
Consolidated tracking issue for test infrastructure, strategy, and improvements. Replaces #462, #568, #569.
Current Testing Map
Tests That Run in CI
| Test Type |
Location |
Count |
Mocking |
CI Job |
| Unit tests |
src/**/*.rs #[cfg(test)] |
~100+ |
None |
test-unit (parallel) |
| MCP tool tests |
redisctl-mcp/tests/ |
41 |
wiremock |
test-integration |
| CLI basic tests |
redisctl/tests/cli_*.rs |
384+ |
None (no API calls) |
test-integration |
| Cloud output tests |
redisctl/tests/cloud_output_test.rs |
~10 |
wiremock |
test-integration |
Tests That Require Docker (Manual/--ignored)
| Test Type |
Location |
Count |
Requirement |
| docker-wrapper tests |
redisctl/tests/docker_wrapper_tests.rs |
10 |
Docker + Redis |
| Enterprise Docker tests |
redisctl/tests/enterprise_docker_*.rs |
44 |
docker-compose + RE |
| Root integration tests |
tests/integration/*.rs |
~20 |
docker-compose + RE |
Coverage Summary
| Component |
Coverage |
Notes |
| redis-cloud library |
~95% |
Comprehensive wiremock tests |
| redis-enterprise library |
~100% |
Comprehensive wiremock tests |
| redisctl-config |
~76% |
Config, credentials, profiles |
| CLI command wrappers |
~0-30% |
Thin glue code, low ROI to unit test |
| Workflows |
0% |
subscription-setup, init-cluster |
| Async utils |
0% |
Polling, timeout, retry logic |
| Support package |
2% |
Binary tar.gz handling |
| Overall |
~24% |
Libraries high, CLI glue low |
Test Infrastructure
Mocking Stack:
├── wiremock 0.6 - HTTP server mocking
├── redis-cloud/testing - Cloud API fixtures & MockCloudServer
└── redis-enterprise/testing - Enterprise API fixtures & MockEnterpriseServer
CLI Testing:
├── assert_cmd 2.0 - Command execution & assertions
├── predicates 3.0 - Output matching
└── tempfile 3.8 - Isolated config directories
Container Testing:
├── docker-wrapper - RAII container lifecycle (Redis)
└── docker-compose - Redis Enterprise cluster
Testing Strategy
Philosophy
- Libraries are the source of truth - redis-cloud and redis-enterprise have 95-100% coverage with wiremock mocks
- CLI is thin glue - Command handlers mostly parse args → call library → format output. Low ROI to unit test.
- Integration tests validate UX - assert_cmd tests cover argument parsing, help text, error messages
- Real API tests are burn-in - Nightly tests against real Cloud/Enterprise catch integration issues
Burn-In Policy
Features are considered "validated" when they've passed:
- Unit tests (if applicable)
- Mocked integration tests
- At least one nightly cycle against real API
Until a feature has been through a real API test cycle, it should be flagged in release notes as "not yet validated against production APIs."
Future Infrastructure
Phase 1: Self-Hosted Runner for Enterprise Tests
Goal: Run Enterprise Docker tests in CI nightly
name: Nightly Enterprise Tests
on:
schedule:
- cron: '0 3 * * *' # 3am UTC
workflow_dispatch:
jobs:
enterprise-tests:
runs-on: self-hosted # Runner with Docker access
steps:
- uses: actions/checkout@v4
- name: Start Redis Enterprise
run: docker compose up -d && sleep 60
- name: Run Enterprise tests
run: cargo test --test enterprise_docker_integration_tests -- --ignored
- name: Run docker-wrapper tests
run: cargo test --test docker_wrapper_tests -- --ignored
- name: Cleanup
if: always()
run: docker compose down -v
Requirements:
Phase 2: Cloud Test Account
Goal: Run real Cloud API tests nightly
name: Nightly Cloud Tests
on:
schedule:
- cron: '0 4 * * *' # 4am UTC
workflow_dispatch:
jobs:
cloud-tests:
runs-on: ubuntu-latest
env:
REDIS_CLOUD_API_KEY: ${{ secrets.CLOUD_TEST_API_KEY }}
REDIS_CLOUD_API_SECRET: ${{ secrets.CLOUD_TEST_API_SECRET }}
steps:
- uses: actions/checkout@v4
- name: Run read-only Cloud tests
run: cargo test --test cloud_integration_tests
- name: Run write tests with cleanup
run: cargo test --test cloud_write_tests -- --ignored
- name: Orphan cleanup
if: always()
run: |
# Delete any ci-test-* resources older than 1 hour
cargo run -- cloud subscription list -o json \
-q "[?starts_with(name, 'ci-test-')]" | ...
Requirements:
Phase 3: Nightly Test Report
Aggregate results from both nightly jobs:
- Enterprise test pass/fail
- Cloud test pass/fail
- Coverage delta
- Any orphaned resources
Action Items
Documentation
Infrastructure
Test Coverage (High-Value Areas)
Test Organization
Running Tests Locally
# Everything that runs in CI
cargo test --workspace --all-features
# Just unit tests (fast)
cargo test --lib --all-features
# Just CLI tests
cargo test --test cli_basic_tests --test cli_profile_tests
# Docker tests (requires Docker)
cargo test --test docker_wrapper_tests -- --ignored --nocapture
# Enterprise Docker tests (requires docker-compose up)
docker compose up -d
# Wait for cluster ready...
cargo test --test enterprise_docker_integration_tests -- --ignored
# With container reuse (faster iteration)
REUSE_CONTAINERS=1 cargo test --test docker_wrapper_tests -- --ignored
Closes
Overview
Consolidated tracking issue for test infrastructure, strategy, and improvements. Replaces #462, #568, #569.
Current Testing Map
Tests That Run in CI
src/**/*.rs#[cfg(test)]test-unit(parallel)redisctl-mcp/tests/test-integrationredisctl/tests/cli_*.rstest-integrationredisctl/tests/cloud_output_test.rstest-integrationTests That Require Docker (Manual/
--ignored)redisctl/tests/docker_wrapper_tests.rsredisctl/tests/enterprise_docker_*.rstests/integration/*.rsCoverage Summary
Test Infrastructure
Testing Strategy
Philosophy
Burn-In Policy
Features are considered "validated" when they've passed:
Until a feature has been through a real API test cycle, it should be flagged in release notes as "not yet validated against production APIs."
Future Infrastructure
Phase 1: Self-Hosted Runner for Enterprise Tests
Goal: Run Enterprise Docker tests in CI nightly
Requirements:
Phase 2: Cloud Test Account
Goal: Run real Cloud API tests nightly
Requirements:
Phase 3: Nightly Test Report
Aggregate results from both nightly jobs:
Action Items
Documentation
TESTING.mdwith test execution guideInfrastructure
Test Coverage (High-Value Areas)
Test Organization
Running Tests Locally
Closes