Some checks failed
Deploy Development / deploy (push) Successful in 41s
Test Suite / compose-smoke (push) Failing after 3s
Test Suite / pytest-backend (push) Has been skipped
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 1m7s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Co-authored-by: Cursor <cursoragent@cursor.com>
31 lines
651 B
Python
31 lines
651 B
Python
import os
|
|
|
|
import pytest
|
|
from fastapi.testclient import TestClient
|
|
|
|
|
|
@pytest.fixture()
|
|
def client(monkeypatch):
|
|
monkeypatch.setenv("SKIP_DB_MIGRATE", "1")
|
|
import importlib
|
|
|
|
import main as main_module
|
|
|
|
importlib.reload(main_module)
|
|
return TestClient(main_module.app)
|
|
|
|
|
|
def test_app_importable():
|
|
import main
|
|
|
|
assert main.app is not None
|
|
|
|
|
|
def test_health_endpoint(client):
|
|
response = client.get("/api/health")
|
|
assert response.status_code == 200
|
|
payload = response.json()
|
|
assert payload["app"] == "jinkendo-kairo"
|
|
assert payload["status"] in {"ok", "degraded"}
|
|
assert payload["db"] in {"ok", "error"}
|