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
First PR off the testing roadmap (#1278). Bundles three changes that depend on each other.
Scope (roadmap items 1 + 2 + 3)
2. Test-settings shim (do first — CI depends on it)
Add makeabilitylab/settings_test.py that imports * from settings and sets MIGRATION_MODULES = {'website': None}.
Tests run with manage.py test website --settings=makeabilitylab.settings_test; the runner derives schema directly from current models (--run-syncdb behavior), bypassing the gitignored, per-environment migration history.
3. Split website/tests.py into a website/tests/ package
tests/__init__.py, tests/base.py (the DatabaseTestCase base, fixture helpers, GIF/PDF byte constants).
Group existing classes into test_bio_utils.py, test_publication.py, test_serve_pdf.py, test_artifact.py, test_data_health.py, test_views.py, test_models.py, etc.
Pure move — Django auto-discovers tests/test_*.py. No behavior change; assert identical test count before/after.
1. GitHub Actions CI
.github/workflows/test.yml: trigger on pull_request and push to master.
Postgres 16 service container; Python 3.13; pip install -r requirements.txt; run the suite with the test settings shim.
Mirror the local env (the [Postgres]-absent → HOST=db default; CI overrides DB host/creds via env to point at the service container).
Acceptance criteria
manage.py test website --settings=makeabilitylab.settings_test passes locally from a clean test DB with no manual drop step.
Test count after the package split == count before (no tests lost).
A pushed PR shows a green check; an intentionally-broken test shows a red ✗ + email.
No branch protection enabled yet — CI reports only (can tighten later).
First PR off the testing roadmap (#1278). Bundles three changes that depend on each other.
Scope (roadmap items 1 + 2 + 3)
2. Test-settings shim (do first — CI depends on it)
makeabilitylab/settings_test.pythat imports*fromsettingsand setsMIGRATION_MODULES = {'website': None}.manage.py test website --settings=makeabilitylab.settings_test; the runner derives schema directly from current models (--run-syncdbbehavior), bypassing the gitignored, per-environment migration history.column "..." already existstest-DB failures noted in Need much better testing infracture on local host #1267 and CLAUDE.md — and required for CI, since a clean runner has no migrations on disk.3. Split
website/tests.pyinto awebsite/tests/packagetests/__init__.py,tests/base.py(theDatabaseTestCasebase, fixture helpers, GIF/PDF byte constants).test_bio_utils.py,test_publication.py,test_serve_pdf.py,test_artifact.py,test_data_health.py,test_views.py,test_models.py, etc.tests/test_*.py. No behavior change; assert identical test count before/after.1. GitHub Actions CI
.github/workflows/test.yml: trigger onpull_requestandpushtomaster.pip install -r requirements.txt; run the suite with the test settings shim.[Postgres]-absent →HOST=dbdefault; CI overrides DB host/creds via env to point at the service container).Acceptance criteria
manage.py test website --settings=makeabilitylab.settings_testpasses locally from a clean test DB with no manual drop step.Out of scope (later PRs)
Coverage (#1278 item 4), test backfill (item 5), Pa11y-in-CI (item 6).
Part of #1278.