""" Health endpoint tests. test_health — existing sync test, validates current behavior (Plan 01 baseline). test_health_checks_postgres_and_minio — xfail scaffold for Plan 05 extended health probe. """ from __future__ import annotations import pytest def test_health(client): resp = client.get("/health") assert resp.status_code == 200 assert resp.json() == {"status": "ok"} @pytest.mark.xfail(strict=False, reason="extended health probe implemented in plan 05") async def test_health_checks_postgres_and_minio(async_client): """Plan 05 extends /health to include per-service connectivity checks (D-07, STORE-07).""" resp = await async_client.get("/health") assert resp.status_code == 200 data = resp.json() assert "checks" in data, "Response missing 'checks' key" assert "postgres" in data["checks"], "checks missing 'postgres'" assert "minio" in data["checks"], "checks missing 'minio'" assert data["checks"]["postgres"] == "ok", f"postgres check: {data['checks']['postgres']!r}" assert data["checks"]["minio"] == "ok", f"minio check: {data['checks']['minio']!r}" assert data["status"] == "ok", f"overall status: {data['status']!r}"