This commit is contained in:
Андрей Сумин
2025-02-28 21:52:48 +03:00
commit 70325c3c0d
63 changed files with 3690 additions and 0 deletions
View File
+29
View File
@@ -0,0 +1,29 @@
import logging
from http import HTTPStatus as status
from httpx import Client
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def test_healthcheck(client: Client) -> None:
response = client.get("/health?format=json")
assert response.status_code == status.OK
response_data = response.json()
unhealthy_services = [
service
for service, status in response_data.items()
if status != "working"
]
for service in unhealthy_services:
logger.error(
"Service %s unhealthy: %s", service, response_data[service]
)
assert not unhealthy_services, (
f"Some services are unhealthy: {', '.join(unhealthy_services)}"
)