-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
Overview
Based on the comprehensive test coverage analysis in COVERAGE_TODO.md, several critical modules need improved test coverage to reach the 90%+ target.
Current Coverage Status
- Overall Coverage: 70% (target: 90%+)
- AWS Provider: 32% (target: 90%+)
- Notebook Magic Module: 48% (target: 90%+)
Priority Areas
1. AWS Provider (High Priority)
Current Coverage: 32% → Target: 90%+
Missing Test Coverage:
- ClientError mocking in tests needs proper exception handling
- VPC creation and management (
_create_or_get_vpc_for_eks
) - Subnet creation (
_create_eks_subnets
) - Security group management (
_create_eks_security_groups
) - EKS cluster lifecycle (create, delete, status)
- EC2 instance lifecycle (create, delete, status)
- Node group management
- Cost estimation with all instance types
- Region and instance type retrieval
- Cluster configuration generation
- Error handling for all AWS API calls
Technical Issues:
- Fix ClientError mocking: Use
from clustrix.cloud_providers.aws import ClientError
instead of patching - Add comprehensive edge case testing
- Test both EKS and EC2 cluster types
- Test authentication edge cases
2. Notebook Magic Module (High Priority)
Current Coverage: 48% → Target: 90%+
File: clustrix/notebook_magic.py
(1236 statements, 648 missing)
Missing Test Coverage:
- Jupyter magic command parsing
- Interactive widget functionality
- Configuration management
- Cloud provider integration
- Error handling for invalid configurations
- Magic command registration and execution
Implementation Strategy
Phase 1: AWS Provider Tests
- Fix ClientError mocking issues
- Add comprehensive VPC/subnet/security group tests
- Test EKS cluster lifecycle completely
- Test EC2 instance lifecycle completely
- Add edge case and error handling tests
Phase 2: Notebook Magic
- Mock Jupyter environment for testing
- Test magic command parsing and execution
- Test widget configuration management
- Test cloud provider integration through widgets
Success Criteria
- Overall test coverage ≥ 90%
- All cloud providers ≥ 95% coverage
- No critical functionality untested
- All edge cases and error conditions covered
- Tests are maintainable and reliable
Labels: enhancement, testing, coverage
Priority: High
Source: Content preserved from COVERAGE_TODO.md during Issue #74 content preservation automation.