diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b242810..afc9dc2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -112,6 +112,17 @@ python manage.py test Ensure all tests pass successfully. +To measure test coverage locally: + +```bash +cd backend +coverage run manage.py test +coverage report +coverage html +``` + +The generated HTML report will be available in `backend/htmlcov/`. + --- ## Code Style Guidelines diff --git a/backend/.coveragerc b/backend/.coveragerc new file mode 100644 index 0000000..0f71bf1 --- /dev/null +++ b/backend/.coveragerc @@ -0,0 +1,18 @@ +[run] +branch = True +source = + backend + campaigns + leads + tenants + users + +[report] +omit = + */migrations/* + */venv/* + */.venv/* + */__pycache__/* + +[html] +directory = htmlcov diff --git a/requirements.txt b/requirements.txt index 6033172..59be323 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,3 +13,4 @@ google-auth-oauthlib>=1.2,<2.0 firebase-admin>=6.5,<7.0 twilio>=9.0,<10.0 gunicorn>=20.1,<21.0 +coverage>=7.6,<8.0