Skip to content

Conversation

@joshrotenberg
Copy link
Collaborator

Summary

This PR adds comprehensive test coverage for three critical Redis Cloud API handlers, continuing the testing effort from PR #89.

Test Coverage Added

🔌 Connectivity Handler (19 tests)

  • VPC peering operations (create, update, delete, get)
  • Private Service Connect (PSC) service operations
  • Transit Gateway (TGW) attachment management
  • Multi-cloud provider support (AWS, GCP, Azure)
  • Comprehensive error handling (401, 403, 404, 500)

💾 Databases Handler (18 tests)

  • Full CRUD operations for database management
  • Database backup and restore operations
  • Database import functionality
  • Support for databases with modules (RediSearch, RedisJSON)
  • Alert configuration testing
  • Clustering and sharding configurations
  • Task status tracking with error responses

🔧 Fixed Databases Handler (11 tests)

  • Fixed subscription database CRUD operations
  • Backup and import operations
  • Tag management (create, update, delete)
  • Error handling for all failure scenarios

Testing Approach

All tests follow the established patterns from PR #89:

  • ✅ Use wiremock for HTTP response mocking
  • ✅ Follow OpenAPI specification for response structures
  • ✅ Test all handler methods comprehensively
  • ✅ Include error handling for common HTTP status codes
  • ✅ Use typed request/response structs from the library
  • ✅ Support for optional fields and forward compatibility

Test Results

cargo test --package redis-cloud --test connectivity_tests
test result: ok. 19 passed; 0 failed

cargo test --package redis-cloud --test databases_tests  
test result: ok. 18 passed; 0 failed

cargo test --package redis-cloud --test fixed_databases_tests
test result: ok. 11 passed; 0 failed

Related Issues

Continues test coverage improvements started in #89

Checklist

  • Tests pass locally
  • Code formatted with cargo fmt
  • Tests follow existing patterns
  • Error cases covered
  • Multi-cloud scenarios tested where applicable

…databases, and fixed_databases handlers

- Added 19 tests for connectivity handler covering VPC peering, PSC, TGW operations
- Added 18 tests for databases handler covering CRUD operations and error cases
- Added 11 tests for fixed_databases handler covering CRUD and tag operations
- All tests include comprehensive error handling (401, 403, 404, 500)
- Tests follow established patterns from previous test coverage work
@joshrotenberg joshrotenberg merged commit 8d22ab7 into main Sep 3, 2025
5 of 10 checks passed
@joshrotenberg joshrotenberg deleted the feat/test-coverage-connectivity-databases branch September 3, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants