Testing Strategy¶
This page describes practical test strategy for OpenSESA development.
Test Pyramid Guidance¶
flowchart TD
A[Unit tests] --> B[Module integration tests]
B --> C[End-to-end and smoke checks] Test Scope Heuristics¶
- Unit tests: pure logic, serializers, validation helpers.
- Integration tests: views, forms, permissions, query behavior.
- Smoke checks: high-value end-to-end user workflows.
Fast Feedback Loop¶
docker compose run --rm app sh -c "DJANGO_SETTINGS_MODULE=app.settings_test PYTHONPATH=. pytest --collect-only -q"
docker compose run --rm app sh -c "DJANGO_SETTINGS_MODULE=app.settings_test PYTHONPATH=. pytest -q"
Coverage and Quality¶
- Respect configured coverage threshold.
- Add targeted tests for changed paths and edge conditions.
- Prefer deterministic fixtures and factory-based setup.
Collapsed flaky-test triage
Reproduce with focused test selection, inspect time and order dependence, and remove hidden shared state assumptions.