Quail keeps tests fast and deterministic. Most coverage uses pytest with the FastAPI TestClient, so no systemd services or Postfix are required for local runs.
Tests are tagged with markers:
unit: pure logic or database tests.api: FastAPI endpoints exercised via TestClient.integration: multi-module or persistence-heavy paths.slow: heavy or long-running checks (reserved for scheduled CI).
Run the standard suite (mirrors CI):
pytest -m "not slow" -raRun a focused subset:
pytest -m unit -ra
pytest -m api -ra
pytest -m integration -raCI runs the main suite on every push with -m "not slow" and schedules a nightly
job for integration/slow tests. Use markers to keep quick feedback loops while
retaining deeper coverage in scheduled runs.
Quail includes local Playwright-based E2E smoke coverage under tests/e2e/.
These tests target a running local service and validate the inbox/message UI,
theme persistence, and refresh health.
Requirements:
- A running local Quail service at
http://127.0.0.1:8000. - Playwright dependencies installed (
sudo /opt/quail/.venv-e2e/bin/playwright install-depsif needed). - Chromium installed via Playwright.
Recommended setup (local-only):
python3 -m venv .venv-e2e
./.venv-e2e/bin/python -m pip install -r tests/e2e/requirements.txt
./.venv-e2e/bin/python -m playwright install chromiumRun the E2E suite:
BASE_URL=http://127.0.0.1:8000 QUAIL_E2E_ADMIN_PIN=<ADMIN_PIN> \
./.venv-e2e/bin/python -m pytest tests/e2eBaseline screenshots and perf capture commands are documented in
tests/e2e/RUNBOOK.md.
Quail serves a bundled stylesheet from quail/static/quail.css. If you edit any
CSS partials under quail/templates/partials/styles/, rebuild the bundle and
restart the service so the cache-buster updates:
make css-bundle
sudo systemctl restart quailOr in one step:
make css-bundle-restartThe test suite includes a bundle guard (tests/test_css_bundle.py) that fails
if quail/static/quail.css is stale or missing.
make test rebuilds the bundle automatically if the partials have changed.