EU-Utility/tests/README.md

74 lines
1.8 KiB
Markdown

# EU-Utility Test Suite
Comprehensive test suite for EU-Utility with >80% code coverage.
## Structure
```
tests/
├── conftest.py # Shared fixtures and configuration
├── unit/ # Unit tests for core services
│ ├── test_event_bus.py
│ ├── test_plugin_api.py
│ ├── test_nexus_api.py
│ ├── test_data_store.py
│ ├── test_settings.py
│ ├── test_tasks.py
│ ├── test_log_reader.py
│ └── test_ocr_service.py
├── integration/ # Integration tests for plugins
│ ├── test_plugin_lifecycle.py
│ ├── test_plugin_communication.py
│ └── test_plugin_events.py
├── ui/ # UI automation tests
│ ├── test_overlay_window.py
│ └── test_dashboard.py
├── performance/ # Performance benchmarks
│ └── test_performance.py
├── mocks/ # Mock services for testing
│ ├── mock_overlay.py
│ ├── mock_api.py
│ └── mock_services.py
└── fixtures/ # Test data and fixtures
├── sample_logs/
└── sample_images/
```
## Running Tests
```bash
# Run all tests
pytest
# Run with coverage report
pytest --cov=core --cov=plugins --cov-report=html
# Run specific test categories
pytest -m unit
pytest -m integration
pytest -m ui
pytest -m performance
# Run tests excluding slow ones
pytest -m "not slow"
# Run tests excluding network-dependent
pytest -m "not requires_network"
```
## Coverage Requirements
- Core services: >90%
- Plugin base: >85%
- Integration tests: >80%
- Overall: >80%
## CI/CD
Tests run automatically on:
- Every push to main
- Every pull request
- Nightly builds
See `.github/workflows/test.yml` for configuration.