fix: Update test script to use root endpoint for health check
Nginx load balancer intercepts /health and returns plain text. Updated test to use root endpoint (/) which returns JSON and verify backend is actually running.
This commit is contained in:
parent
9f5aee8b93
commit
d9b6b66813
@ -183,22 +183,23 @@ def test_backend_health():
|
||||
print("="*60)
|
||||
|
||||
try:
|
||||
response = requests.get(f"{BASE_URL}/health")
|
||||
# Try the root endpoint for health (Nginx intercepts /health with plain text)
|
||||
response = requests.get(f"{BASE_URL}/")
|
||||
data = response.json()
|
||||
|
||||
if data.get("status") == "ok":
|
||||
if data.get("name"):
|
||||
print(f"✓ Backend is running")
|
||||
print(f" Status: {data['status']}")
|
||||
print(f" Name: {data['name']}")
|
||||
print(f" Version: {data.get('version', 'unknown')}")
|
||||
return True
|
||||
else:
|
||||
print(f"✗ Backend health check failed: {data}")
|
||||
print(f"✗ Backend response unexpected: {data}")
|
||||
return False
|
||||
|
||||
except requests.exceptions.ConnectionError:
|
||||
print("✗ Cannot connect to backend")
|
||||
print(f" Make sure backend is running on {BASE_URL}")
|
||||
print(" Run: docker compose up -d backend")
|
||||
print(" Run: docker compose -f docker-compose.multinode.yml up -d")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"✗ Error: {e}")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user