From 5ac34308661959b7051a44e8ffb0bf7456bcfef2 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Mon, 16 Feb 2026 20:08:38 -0800 Subject: [PATCH] only tests for /ui --- .github/workflows/test_server_root_path.yml | 245 +------------------- 1 file changed, 8 insertions(+), 237 deletions(-) diff --git a/.github/workflows/test_server_root_path.yml b/.github/workflows/test_server_root_path.yml index 9a13494b48..bc55981750 100644 --- a/.github/workflows/test_server_root_path.yml +++ b/.github/workflows/test_server_root_path.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - root_path: ["/api/v1"] + root_path: ["/api/v1", "/llmproxy"] steps: - name: Checkout repository @@ -50,7 +50,7 @@ jobs: while [ $attempt -lt $max_attempts ]; do if docker logs litellm-test 2>&1 | grep -q "Uvicorn running"; then - echo "✅ LiteLLM started successfully" + echo "LiteLLM started successfully" break fi attempt=$((attempt + 1)) @@ -59,265 +59,36 @@ jobs: done if [ $attempt -eq $max_attempts ]; then - echo "❌ Server failed to start within timeout" + echo "Server failed to start within timeout" docker logs litellm-test exit 1 fi - # Additional wait for full initialization sleep 5 - name: Show container logs if: always() - run: | - echo "=== Container Logs ===" - docker logs litellm-test + run: docker logs litellm-test - - name: Test health endpoint with root path + - name: Test UI endpoint with root path run: | ROOT_PATH="${{ matrix.root_path }}" - echo "Testing health endpoint at: http://localhost:4000${ROOT_PATH}/health" - - for i in 1 2 3; do - response=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 -H "Authorization: Bearer sk-1234" "http://localhost:4000${ROOT_PATH}/health") - if [ "$response" = "200" ]; then - echo "✅ Health endpoint returned 200" - exit 0 - fi - echo "Attempt $i/3 - got $response, retrying in 5s..." - sleep 5 - done - echo "❌ Health endpoint returned $response (expected 200)" - docker logs litellm-test - exit 1 - - - name: Test health endpoint liveliness with root path - run: | - ROOT_PATH="${{ matrix.root_path }}" - echo "Testing liveliness endpoint at: http://localhost:4000${ROOT_PATH}/health/liveliness" - - for i in 1 2 3; do - response=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 -H "Authorization: Bearer sk-1234" "http://localhost:4000${ROOT_PATH}/health/liveliness") - if [ "$response" = "200" ]; then - echo "✅ Liveliness endpoint returned 200" - exit 0 - fi - echo "Attempt $i/3 - got $response, retrying in 5s..." - sleep 5 - done - echo "❌ Liveliness endpoint returned $response (expected 200)" - docker logs litellm-test - exit 1 - - - name: Test health endpoint readiness with root path - run: | - ROOT_PATH="${{ matrix.root_path }}" - echo "Testing readiness endpoint at: http://localhost:4000${ROOT_PATH}/health/readiness" - - for i in 1 2 3; do - response=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 -H "Authorization: Bearer sk-1234" "http://localhost:4000${ROOT_PATH}/health/readiness") - if [ "$response" = "200" ]; then - echo "✅ Readiness endpoint returned 200" - exit 0 - fi - echo "Attempt $i/3 - got $response, retrying in 5s..." - sleep 5 - done - echo "❌ Readiness endpoint returned $response (expected 200)" - docker logs litellm-test - exit 1 - - - name: Test UI is accessible with root path - run: | - ROOT_PATH="${{ matrix.root_path }}" - echo "Testing UI endpoint at: http://localhost:4000${ROOT_PATH}/ui" - - for i in 1 2 3; do - response=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 -H "Authorization: Bearer sk-1234" "http://localhost:4000${ROOT_PATH}/ui") - if [[ "$response" =~ ^(200|30[0-9])$ ]]; then - echo "✅ UI endpoint returned $response" - exit 0 - fi - echo "Attempt $i/3 - got $response, retrying in 5s..." - sleep 5 - done - echo "❌ UI endpoint returned $response (expected 200 or 30x)" - docker logs litellm-test - exit 1 - - - name: Test UI index page content with root path - run: | - ROOT_PATH="${{ matrix.root_path }}" - echo "Testing UI content at: http://localhost:4000${ROOT_PATH}/ui/" + echo "Testing UI at: http://localhost:4000${ROOT_PATH}/ui/" for i in 1 2 3; do content=$(curl -sL --max-time 5 -H "Authorization: Bearer sk-1234" "http://localhost:4000${ROOT_PATH}/ui/") if echo "$content" | grep -q -E "(html|&1 | grep -q "Uvicorn running"; then - echo "✅ LiteLLM started successfully" - break - fi - attempt=$((attempt + 1)) - echo "Attempt $attempt/$max_attempts - waiting for server to start..." - sleep 2 - done - - if [ $attempt -eq $max_attempts ]; then - echo "❌ Server failed to start within timeout" - docker logs litellm-test - exit 1 - fi - - sleep 5 - - - name: Test default paths work without SERVER_ROOT_PATH - run: | - echo "Testing that default paths work when SERVER_ROOT_PATH is not set" - - for i in 1 2 3; do - health=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 -H "Authorization: Bearer sk-1234" "http://localhost:4000/health") - ui=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 -H "Authorization: Bearer sk-1234" "http://localhost:4000/ui") - - if [ "$health" = "200" ] && [[ "$ui" =~ ^(200|30[0-9])$ ]]; then - echo "✅ Default paths work correctly" - exit 0 - fi - echo "Attempt $i/3 - health: $health, ui: $ui, retrying in 5s..." - sleep 5 - done - echo "❌ Default paths failed (health: $health, ui: $ui)" - docker logs litellm-test - exit 1 - - name: Cleanup if: always() run: |