generated from john/python-template
gpt-5.3 codex review: Phase 7 and the addition of the new test-effectiveness-auditor skill.
Quality Gate / gate (push) Failing after 12s
Quality Gate / gate (push) Failing after 12s
This commit is contained in:
@@ -4,12 +4,13 @@ from fastapi import FastAPI
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from transcription.api.health import router
|
||||
from transcription.worker import WorkerHealthSnapshot
|
||||
|
||||
|
||||
class TestHealthEndpoint:
|
||||
"""Verify /healthz endpoint behavior."""
|
||||
|
||||
def test_healthz_returns_ok_status(self):
|
||||
def test_healthz_returns_ok_status_with_unknown_worker_when_uninitialized(self):
|
||||
"""GET /healthz returns a healthy status payload."""
|
||||
app = FastAPI()
|
||||
app.include_router(router)
|
||||
@@ -18,4 +19,26 @@ class TestHealthEndpoint:
|
||||
response = client.get("/healthz")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.json() == {"status": "ok"}
|
||||
assert response.json() == {"status": "ok", "worker": {"state": "unknown"}}
|
||||
|
||||
def test_healthz_returns_worker_failure_metadata_when_available(self):
|
||||
app = FastAPI()
|
||||
app.state.worker_health = WorkerHealthSnapshot(
|
||||
state="failed",
|
||||
error_id="abc12345",
|
||||
error_category="internal_unexpected_error",
|
||||
)
|
||||
app.include_router(router)
|
||||
client = TestClient(app)
|
||||
|
||||
response = client.get("/healthz")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.json() == {
|
||||
"status": "ok",
|
||||
"worker": {
|
||||
"state": "failed",
|
||||
"error_id": "abc12345",
|
||||
"error_category": "internal_unexpected_error",
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user