This repository follows a structured testing approach that mirrors the codebase organization to ensure maintainability and clarity.
tests/
├── unit/ # Unit tests for individual components
│ ├── phase/ # Tests for legacy phase modules
│ └── phase_polars/ # Tests for new phase_polars framework
│ ├── load/ # Load phase unit tests
│ └── transform/ # Transform phase unit tests
├── integration/ # Integration tests for component interactions
│ ├── phase/ # Legacy phase integration tests
│ └── phase_polars/ # Phase_polars integration tests
│ ├── load/ # Load phase integration tests
│ └── transform/ # Transform phase integration tests
├── e2e/ # End-to-end tests
├── acceptance/ # Acceptance tests
└── performance/ # Performance tests
- Mirror Source Structure: Test directories should mirror the source code structure
- Separation of Concerns: Unit, integration, and e2e tests are clearly separated
- Framework Isolation: Legacy
phase/and newphase_polars/tests are isolated
The phase_polars test structure follows the modular design of the new ETL framework:
- Load Tests:
load/test_save_database.py,load/test_save_file.py - Transform Tests: Individual test files for each transform phase:
transform/test_convert.pytransform/test_normalise.pytransform/test_filter.pytransform/test_validate.py- And 14 additional transform phase test files
- Load Integration:
load/test_load_integration.py - Transform Integration:
transform/test_transform_integration.py - Individual Phase Integration: Separate files for each transform phase
- Test files:
test_<module_name>.py - Test classes:
Test<ClassName> - Test methods:
test_<functionality> - Integration test files:
test_<component>_integration.py
# Run all tests
pytest
# Run unit tests only
pytest tests/unit/
# Run phase_polars tests only
pytest tests/unit/phase_polars/ tests/integration/phase_polars/
# Run specific test file
pytest tests/unit/phase_polars/transform/test_convert.py
# Run with verbose output
pytest -v tests/unit/phase_polars/Currently, the phase_polars test files contain placeholder structures ready for implementation once the corresponding phase modules are developed. This ensures:
- Consistent Structure: All test files follow the same organizational pattern
- Ready for Development: Test structure is prepared for parallel development
- Clear Separation: Unit and integration tests are clearly distinguished
- pytest: Primary testing framework
- pytest-mock: For mocking dependencies
- coverage: For test coverage reporting
- Tests will be implemented as phase_polars modules are developed
- Integration tests will validate data flow between phases
- Performance tests may be added for large dataset processing