Skip to content

Testing

# Inside compose (recommended)
docker compose run --rm --no-deps web pytest -q

# Host venv (locked — matches CI/image)
pip install --require-hashes -r requirements.lock.txt
pip install --no-deps -e .
pytest -q

Unit tests live under tests/ — no live SSH required for the main suite.

Examples: test_rbac.py, test_api_tokens.py, test_service_templates.py, test_backup_paths.py, test_herder_backup.py, test_job_exclusive.py (no double OS/container jobs; stack job types), test_request_ip_audit.py (Caddy XFF + audit client_ip), test_dns_fabric.py (paths, Hosts/Path SVG, cloud/LAN classification, spine layout, GET-safe view, case-insensitive Docker fabric index), test_jwt_tokens.py (PyJWT HS256), test_server_job_lock.py (backup mutex), …

# Network maps only
docker compose exec -T web python -m pytest tests/test_dns_fabric.py -q

CI

GitHub Actions runs unit tests on push/PR to main when app, tests, migrations, lockfiles, or pyproject.toml change:

  • Workflow: .github/workflows/test.yml
  • pip install --require-hashes -r requirements.lock.txt + pip install --no-deps -e . + pytest -q on Python 3.12

Docs site builds separately via .github/workflows/docs.yml.

Before a release

  1. pytest -q green (local or CI)
  2. Manual smoke: register, add server, backup, template deploy, metrics, API token
  3. See release checklist in docs/RELEASE_v*.md / PLAN_v0.5.0