From b05ed09bc7fe8adf651e7733c5788077356fd372 Mon Sep 17 00:00:00 2001 From: leehk Date: Fri, 18 Apr 2025 11:13:58 +0800 Subject: [PATCH] check network connection for backend-aimingmedai --- .github/workflows/template_test.yml | 10 ++++++++++ .../tests/integration/backend/test_frontend_backend.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/template_test.yml b/.github/workflows/template_test.yml index 3545db7..c7449fe 100644 --- a/.github/workflows/template_test.yml +++ b/.github/workflows/template_test.yml @@ -153,6 +153,16 @@ jobs: # Check if all services are healthy docker compose -f "${{ steps.create_compose.outputs.COMPOSE_FILE_PATH }}" ps + - name: Debug Network Connections + if: always() # Run even if previous steps failed + run: | + echo "--- Inspecting network: test-network-${{ github.run_id }} ---" + docker network inspect test-network-${{ github.run_id }} + echo "--- Listing running containers (docker ps) ---" + docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}\t{{.Networks}}" + echo "--- Backend Service Logs ---" + docker logs backend-aimingmedai || echo "Could not get logs for backend-aimingmedai" # Replace with actual service name + - name: Run Tests shell: bash run: | diff --git a/app/tests/tests/integration/backend/test_frontend_backend.py b/app/tests/tests/integration/backend/test_frontend_backend.py index b4e8613..fe62d3e 100644 --- a/app/tests/tests/integration/backend/test_frontend_backend.py +++ b/app/tests/tests/integration/backend/test_frontend_backend.py @@ -6,7 +6,7 @@ import websockets @pytest.mark.asyncio async def test_chatbot_integration(): # Send a request to the chatbot endpoint - url = "ws://localhost:8004/ws" + url = "ws://backend-aimingmedai:80/ws" data = [{"content": "Hello"}] try: async with websockets.connect(url) as websocket: