diff --git a/CHANGELOG.md b/CHANGELOG.md index 661c43d..6518062 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,13 @@ CalVer image tags (`stable-YYYY.MM.N`, `dev-YYYY.MM.N`) are produced for every C concrete next step. Falls back to DuckDB's raw error for non-materialized unknowns. +### Internal +- **tests**: refresh `docker-e2e` health asserts to match the current + `/api/health` shape (auth-free, returns `status` + `db_schema` only). + `version` moved to `/api/version` in 0.10-era refactor; richer + `services.duckdb_state` lives in `/api/health/detailed` (auth-gated). + Tests had drifted and broke nightly e2e on main. + ## [0.30.0] — 2026-05-01 ### Added diff --git a/tests/test_docker_full.py b/tests/test_docker_full.py index caa06eb..b0e3c3e 100644 --- a/tests/test_docker_full.py +++ b/tests/test_docker_full.py @@ -40,12 +40,17 @@ def require_docker(): def test_app_health(): - """Health endpoint returns 200 with status and version fields.""" + """/api/health is the auth-free LB probe — status + db_schema only. + Version metadata moved to /api/version (see app/api/health.py).""" resp = httpx.get(f"{DOCKER_BASE_URL}/api/health", timeout=10) assert resp.status_code == 200 data = resp.json() - assert "status" in data - assert "version" in data + assert data.get("status") == "ok" + assert data.get("db_schema") == "ok" + + ver = httpx.get(f"{DOCKER_BASE_URL}/api/version", timeout=10) + assert ver.status_code == 200 + assert "version" in ver.json() def test_app_returns_html_on_root(): diff --git a/tests/test_e2e_docker.py b/tests/test_e2e_docker.py index 277657e..5fb4b9a 100644 --- a/tests/test_e2e_docker.py +++ b/tests/test_e2e_docker.py @@ -75,12 +75,13 @@ class TestDockerHealth: assert data.get("status") in ("ok", "healthy") def test_health_has_duckdb(self, docker_env): + # /api/health touches system.duckdb to read schema_version, so + # db_schema='ok' implies DuckDB is reachable. The richer + # services.duckdb_state lives in /api/health/detailed (auth-gated). import httpx resp = httpx.get(f"{docker_env}/api/health") data = resp.json() - services = data.get("services", {}) - assert "duckdb_state" in services - assert services["duckdb_state"]["status"] == "ok" + assert data.get("db_schema") == "ok" class TestDockerFullFlow: