-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
in-progressSomething being actively worked onSomething being actively worked on
Description
name: "AWS Provider Comprehensive Testing"
status: open
created: 2025-09-04T00:46:14Z
updated: 2025-09-04T00:46:14Z
github: [Will be updated when synced to GitHub]
depends_on: []
parallel: true
conflicts_with: []
Description
Implement comprehensive test coverage for the AWS provider module (clustrix/providers/aws.py
) with focus on EKS, EC2, and IAM operations. The current coverage is 48% (291 lines, 151 missing) and needs to reach 85%+ coverage using boto3 stubber for AWS API mocking.
Acceptance Criteria
- Test coverage for
clustrix/providers/aws.py
reaches 85%+ (reduce missing lines from 151 to <44) - All EKS operations tested (cluster creation, job submission, status checking)
- All EC2 operations tested (instance management, security groups, key pairs)
- All IAM operations tested (role creation, policy attachment, service accounts)
- Use boto3 stubber for consistent AWS API mocking (no real AWS calls)
- Test error handling for AWS API failures and rate limiting
- Test credential handling and region configuration
- All tests pass in CI/CD pipeline
- No reduction in existing test coverage for other modules
Technical Details
Current Coverage Analysis
- File:
clustrix/providers/aws.py
- Current: 48% coverage (140/291 lines)
- Missing: 151 lines need coverage
- Target: 85%+ coverage (<44 missing lines)
Key Areas to Test
-
EKS Operations
- Cluster creation and configuration
- Job submission to Kubernetes
- Pod status monitoring
- Resource cleanup
-
EC2 Operations
- Instance lifecycle management
- Security group configuration
- Key pair management
- Subnet and VPC handling
-
IAM Operations
- Service role creation
- Policy attachment and permissions
- Service account management
- Cross-service role assumptions
-
Error Scenarios
- AWS API rate limiting
- Credential expiration
- Resource not found errors
- Permission denied scenarios
Testing Strategy
- Use
boto3
stubber for predictable AWS API responses - Test both success and failure scenarios
- Mock AWS credentials and regions consistently
- Verify proper resource cleanup in all paths
Dependencies
- boto3 and botocore (AWS SDK)
- pytest and pytest-mock
- moto library for additional AWS mocking if needed
- Access to existing AWS provider code structure
Effort Estimate
Size: L (5-7 days)
- Research: 1 day (understand current AWS provider implementation)
- Test Design: 1 day (plan test structure and boto3 stubber usage)
- Implementation: 3-4 days (write comprehensive tests)
- Validation: 1 day (verify coverage targets and CI integration)
Definition of Done
- AWS provider test coverage ≥ 85%
- All AWS service operations have test coverage
- boto3 stubber used consistently for API mocking
- Tests cover both success and error scenarios
- All tests pass locally and in CI
- No regression in other module coverage
- Code review completed and approved
- Documentation updated if needed
Metadata
Metadata
Assignees
Labels
in-progressSomething being actively worked onSomething being actively worked on