feat(slice-4): VERSION file + versioned /healthz — the flotilla verify contract (§8.1)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ def test_inv_1_bootstrap_whole_flow_from_empty(fresh_db_url):
|
||||
# fresh_db_url is a brand-new empty database; create_app() self-migrates (INV-7).
|
||||
with TestClient(create_app(database_url=fresh_db_url)) as client:
|
||||
# a fresh deployment serves healthz green before any row exists
|
||||
assert client.get("/healthz").json() == {"status": "ok"}
|
||||
assert client.get("/healthz").json()["status"] == "ok"
|
||||
|
||||
# PUC-2: first visitor requests a code; it reaches them via the dev channel
|
||||
assert client.post(
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
from pathlib import Path
|
||||
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from app.main import create_app
|
||||
|
||||
# /healthz reports the VERSION file's value — the flotilla deploy gate compares
|
||||
# body.version against the pinned target (flotilla-core SPEC §8.1 phase 8).
|
||||
_VERSION = (Path(__file__).resolve().parents[2] / "VERSION").read_text().strip()
|
||||
|
||||
|
||||
def test_healthz_ok_on_migrated_empty_db(fresh_db_url):
|
||||
app = create_app(database_url=fresh_db_url)
|
||||
with TestClient(app) as client:
|
||||
resp = client.get("/healthz")
|
||||
assert resp.status_code == 200
|
||||
assert resp.json() == {"status": "ok"}
|
||||
assert resp.json() == {"status": "ok", "version": _VERSION}
|
||||
|
||||
|
||||
def test_startup_migrates_from_empty(fresh_db_url):
|
||||
|
||||
Reference in New Issue
Block a user