-
Notifications
You must be signed in to change notification settings - Fork 4
Testing and Quality.md
Kelsey Smuczynski edited this page Mar 24, 2026
·
1 revision
tests/
unit/
integration/
transfers/
features/ # BDD scenarios
conftest.py # Rebuilds schema, runs Alembic, syncs search triggers, seeds lexicon/parameter data
Root-level pytest files also cover API/resource behavior.
source .venv/bin/activate
set -a; source .env; set +a
pytest -qImportant repo behavior:
-
tests/__init__.pyforcesPOSTGRES_DB=ocotilloapi_test - Tests normalize
POSTGRES_HOST=dbtolocalhostwhen needed -
tests/conftest.pyrebuilds the schema, runs Alembic, syncs search triggers, and initializes lexicon/parameter data
Many tests assume a live Postgres/PostGIS database. Before running destructive or migration-heavy suites, confirm that your environment is pointing at the test database, not a dev or shared database.
uv run behave tests/features --tags="@backend and @production and not @skip" --no-captureA helper script, run_bdd.sh, syncs BDD feature files from the separate OcotilloBDD repo before running Behave.
tests.yml currently runs:
- Unit/API/integration
pytestagainst a PostGIS service container - Behave BDD tests against a PostGIS service container
| Tool | How It Runs |
|---|---|
black |
Pre-commit hook; CI auto-commit on non-environment branches |
flake8 |
Pre-commit hook; CI run on PRs |
pre-commit |
Local install via pre-commit install
|
The pre-commit config runs black and flake8 focused on serious syntax/import/runtime categories.
Run everything locally before pushing:
pre-commit run --all-files- Run
blackandflake8on all touched files before pushing - Run targeted validation for the modified area
- Run broader validation if the change affects DB boot, migrations, deploy, or shared runtime setup
- Keep tests deterministic and idempotent where possible