This project includes an automated pytest suite covering core services, web flows, socket handlers, and edge-case helper branches.
Install dependencies in the required environment:
path/to/python-venv/bin/pip install -r requirements.txt
path/to/python-venv/bin/pip install pytest pytest-covPYTHONPATH=src path/to/python-venv -m pytestPYTHONPATH=src path/to/python-venv -m pytest \
--cov=src/sonobarr_app \
--cov-report=term-missing \
--cov-report=xmlThis command writes:
coverage.xmlfor SonarQube ingestion.coveragefor local coverage tooling
The GitHub build workflow runs the coverage command before SonarQube analysis in the same job. This keeps SonarQube metrics aligned with the latest tests without uploading build artifacts.
- The active target is 100% line coverage.
- Keep branch-focused regression tests when adding new helpers or error handling paths so the target remains stable.
- Keep using the generated
coverage.xmlas the coverage report input for scanner runs. - Re-run the coverage command after code changes to ensure SonarQube receives current metrics.