Update health endpoint and refine test documentation

- Modified the health endpoint to return "None" for AI availability when inference is not initialized, improving clarity on system status.
- Enhanced the test documentation to include handling of skipped tests, emphasizing the need for investigation before proceeding.
- Updated test assertions to ensure proper execution order and prevent premature engine initialization.
- Refactored test cases to streamline performance testing and improve readability, removing unnecessary complexity.

These changes aim to enhance the robustness of the health check and improve the overall testing framework.
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-03-30 01:17:53 +03:00
parent 5a968edcba
commit 86b8f076b7
11 changed files with 2130 additions and 307 deletions
+4 -3
View File
@@ -124,12 +124,13 @@ def detection_to_dto(det) -> DetectionDto:
@app.get("/health")
def health() -> HealthResponse:
if inference is None:
return HealthResponse(status="healthy", aiAvailability="None")
try:
inf = get_inference()
status = inf.ai_availability_status
status = inference.ai_availability_status
status_str = str(status).split()[0] if str(status).strip() else "None"
error_msg = status.error_message if hasattr(status, 'error_message') else None
engine_type = inf.engine_name
engine_type = inference.engine_name
return HealthResponse(
status="healthy",
aiAvailability=status_str,