This directory contains the test suite for LayerLens, organized into unit tests and integration tests.
tests/
├── conftest.py # Pytest fixtures and configuration
├── unit/ # Unit tests for individual components
│ ├── test_profiling_aggregators.py
│ ├── test_profiling_analyzers.py
│ └── test_optimization_solver.py
├── integration/ # Integration tests for full pipelines
│ └── test_pipeline_e2e.py
└── fixtures/ # Test fixtures and sample data
# Install test dependencies
pip install -e .[dev]
# Run all tests
pytest
# Run with coverage
pytest --cov=layerlens --cov-report=html
# Run specific test file
pytest tests/unit/test_profiling_analyzers.py
# Run with verbose output
pytest -vTest individual components in isolation:
- Profiling aggregators
- Profiling analyzers
- Optimization solver
- Configuration classes
- Model specifications
Test full pipeline workflows:
- End-to-end pipeline execution
- Manifest generation
- Latency profiling
- Multi-model scenarios
- Unit tests: Add to
tests/unit/with descriptive names liketest_<component>_<behavior>.py - Integration tests: Add to
tests/integration/for full workflow tests - Fixtures: Add reusable fixtures to
tests/conftest.py - Follow pytest conventions: Use descriptive test function names starting with
test_
- Unit test coverage: >80%
- Integration test coverage: >60%
- Critical path coverage: 100%