-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Summary
Currently LogStory has minimal test coverage with only basic validation tests. To mature the project, we need comprehensive testing infrastructure with coverage reporting and different types of tests.
Current Testing Gaps
- Limited coverage: Only 2 test files (
test_yaml.py,test_logstory.py) - No unit tests: Core functions in
main.pyandlogstory.pylack unit tests - No integration tests: End-to-end scenarios aren't tested
- No coverage reporting: Unknown how much code is actually tested
- No mock infrastructure: Can't test without real GCP credentials
Proposed Improvements
Phase 1: Test Infrastructure
- Add
coverage.pyandpytestto development dependencies - Create test coverage reporting in CI/CD pipeline
- Set minimum coverage threshold (suggest 80%)
- Add coverage badge to README
Phase 2: Unit Tests
- Write unit tests for all functions in
src/logstory/main.py - Write unit tests for all functions in
src/logstory/logstory.py - Create mock infrastructure for GCP services (Storage, Secret Manager)
- Test error handling and edge cases
Phase 3: Integration Tests
- Create end-to-end test scenarios with sample data
- Test full workflow from log ingestion to timestamp updates
- Add tests for different log type configurations
- Test CLI interface with various flag combinations
Phase 4: Advanced Testing
- Add property-based testing for timestamp parsing using
hypothesis - Create performance benchmarks for large log files
- Add tests for concurrent processing scenarios
Benefits
- Confidence in changes: Catch regressions before they reach production
- Easier refactoring: Safe to improve code with comprehensive test coverage
- Better documentation: Tests serve as executable documentation
- Contributor onboarding: New contributors can understand expected behavior
Acceptance Criteria
- Test coverage ≥80% for core functionality
- All public functions have unit tests
- CI fails if coverage drops below threshold
- Tests can run without external dependencies (using mocks)
- Test suite completes in <2 minutes
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
No labels