You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`<TEST_FILES>` (optional): One or more test file paths or pytest node IDs to run. When provided, only the specified tests are run and coverage is disabled (`--no-cov`). When omitted, the full test suite runs with coverage enabled.
10
+
`<TEST_FILES>` (optional): One or more folders, test file paths, or pytest node IDs to run. Coverage is only enabled when a single folder representing a code domain is provided or no arguments are provided.
11
11
12
12
Examples:
13
13
-`/unit-tests` — run all tests with coverage
14
+
-`/unit-tests enterprise_access/apps/bffs` — run all bff domain tests with domain-only coverage
14
15
-`/unit-tests enterprise_access/apps/customer_billing/tests/test_models.py` — run one test file without coverage
15
16
-`/unit-tests enterprise_access/apps/subsidy_access_policy/tests/test_models.py enterprise_access/apps/content_assignments/tests/test_api.py` — run multiple test files without coverage
16
17
-`/unit-tests enterprise_access/apps/customer_billing/tests/test_models.py::TestSomeClass::test_method` — run a single test by node ID without coverage
-**Single argument that is a directory** (no `.py`, no `::`) → Step 2b (domain tests + domain coverage). Never enable coverage when testing specific files — only for domain or whole-project runs.
Never enable coverage reports (by adding `--cov`) when only testing specific files, since the results will be misleading.
55
+
56
+
### 2b. Run domain unit tests and generate domain-only coverage
57
+
58
+
If `<TEST_FILES>` specifies a single directory which represent a domain, such as a django app, enable coverage.
59
+
60
+
Convert the directory path to a Python module path for `--cov`: replace `/` with `.` and strip any trailing slash. Example: `enterprise_access/apps/bffs/` → `enterprise_access.apps.bffs`
0 commit comments