generated from coulomb/repo-seed
structured logging around key workflows and docs for operational readiness
This commit is contained in:
@@ -64,6 +64,30 @@ def test_docs_endpoint_is_available():
|
||||
assert "openapi.json" in response.text
|
||||
|
||||
|
||||
def test_health_reports_database_and_checkout_root(tmp_path):
|
||||
def override_settings():
|
||||
return Settings(
|
||||
database_path=str(tmp_path / "health.sqlite3"),
|
||||
checkout_root=str(tmp_path / "checkouts"),
|
||||
)
|
||||
|
||||
app.dependency_overrides[get_settings] = override_settings
|
||||
client = TestClient(app)
|
||||
try:
|
||||
response = client.get("/health")
|
||||
|
||||
assert response.status_code == 200
|
||||
body = response.json()
|
||||
assert body["status"] == "ok"
|
||||
assert body["database"]["reachable"] is True
|
||||
assert body["database"]["error"] is None
|
||||
assert body["database"]["path"].endswith("health.sqlite3")
|
||||
assert body["checkout_root"]["path"].endswith("checkouts")
|
||||
assert body["checkout_root"]["exists"] is False
|
||||
finally:
|
||||
app.dependency_overrides.clear()
|
||||
|
||||
|
||||
def test_api_manual_registry_loop(tmp_path):
|
||||
def override_settings():
|
||||
return Settings(
|
||||
@@ -429,6 +453,7 @@ def test_settings_can_load_from_environment(monkeypatch):
|
||||
monkeypatch.setenv("REPO_REGISTRY_LLM_PROVIDER", "mock")
|
||||
monkeypatch.setenv("REPO_REGISTRY_LLM_MODEL", "demo-model")
|
||||
monkeypatch.setenv("REPO_REGISTRY_EMBEDDING_PROVIDER", "hashing")
|
||||
monkeypatch.setenv("REPO_REGISTRY_LOG_LEVEL", "DEBUG")
|
||||
|
||||
settings = Settings()
|
||||
|
||||
@@ -437,6 +462,7 @@ def test_settings_can_load_from_environment(monkeypatch):
|
||||
assert settings.llm_provider == "mock"
|
||||
assert settings.llm_model == "demo-model"
|
||||
assert settings.embedding_provider == "hashing"
|
||||
assert settings.log_level == "DEBUG"
|
||||
|
||||
|
||||
def test_api_analysis_run_loop(tmp_path):
|
||||
|
||||
Reference in New Issue
Block a user