Skip to main content

Testing

:::info Status Implemented. Source: CLAUDE.md, fastapi-backend/pytest.ini. :::

cd fastapi-backend
pip install -r requirements.txt -r requirements-dev.txt
pytest # whole suite
pytest -m "not slow" # skip load and convergence tests

requirements-dev.txt is excluded from the production image.

Database for tests

fastapi-backend/test/conftest.py provisions a disposable Postgres automatically. Override with:

  • AZAN360_TEST_DATABASE_URL — point at a specific database instead.
  • AZAN360_TEST_DB_PROVIDER=none — skip DB-backed tests entirely.

Not a test

fastapi-backend/test/latency_test.py is a benchmark, not a correctness test — don't expect it in a normal pytest run's pass/fail signal.

Rollout rehearsal tests

fastapi-backend/test/test_rollback_rehearsal.py exercises the FANOUT_V2 staged-rollout flag across all seven send paths (off → shadow → enforce → shadow → off) and asserts identical delivery sets — see Backend Deployment.

Broker acceptance (not pytest)

scripts/emqx_acceptance.py runs 19 checks against a throwaway EMQX broker (authentication, ACL subtree, forbidden wildcards, revocation) — it clears and restores a device secret, so never point it at production. Run after any broker upgrade; see Device Deployment.

Frontend

No end-to-end test suite is documented for the three frontend apps as of this writing — verify UI changes manually against a running npm run dev instance per Local Development.