From e865e5de4c187fe982601e2496f3622cbd55d5d8 Mon Sep 17 00:00:00 2001 From: OG T Date: Sun, 29 Mar 2026 20:36:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(e2e):=20=E5=82=B3=E9=81=9E=E9=A9=97?= =?UTF-8?q?=E8=AD=89=E9=81=8E=E7=9A=84=20API=20URL=20=E7=B5=A6=E5=BE=8C?= =?UTF-8?q?=E7=BA=8C=E6=AD=A5=E9=A9=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Health Check 輸出 working_api_url (VIP 或 fallback) - E2E Verification 使用已驗證可用的 URL - 解決 VIP 不通時 E2E 腳本連線失敗問題 Co-Authored-By: Claude Opus 4.5 --- .github/workflows/daily-e2e-health.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/daily-e2e-health.yaml b/.github/workflows/daily-e2e-health.yaml index 4088ee1d..e5b814a6 100644 --- a/.github/workflows/daily-e2e-health.yaml +++ b/.github/workflows/daily-e2e-health.yaml @@ -93,6 +93,7 @@ jobs: kubectl get endpoints -n awoooi-prod awoooi-api || echo "⚠️ kubectl 失敗" - name: Check API Health + id: health run: | API_URL="${{ github.event.inputs.api_url || env.DEFAULT_API_URL }}" echo "🔗 檢查 API 健康狀態..." @@ -111,6 +112,7 @@ jobs: if [ "$HTTP_CODE" = "200" ]; then echo "✅ API 可用: $API_URL (HTTP $HTTP_CODE)" cat /tmp/health_response.txt + echo "working_api_url=$API_URL" >> $GITHUB_OUTPUT else echo "❌ API 無法連線: $API_URL (HTTP $HTTP_CODE)" echo "📋 Response:" @@ -125,6 +127,7 @@ jobs: if [ "$FALLBACK_CODE" = "200" ]; then echo "✅ 備用端點可用,VIP 可能有問題" cat /tmp/fallback_response.txt + echo "working_api_url=$FALLBACK_URL" >> $GITHUB_OUTPUT exit 0 # 備用成功,不算失敗 fi @@ -137,11 +140,12 @@ jobs: env: PYTHONPATH: ${{ github.workspace }}/apps/api run: | - API_URL="${{ github.event.inputs.api_url || env.DEFAULT_API_URL }}" + # 使用 Health Check 驗證過的可用 URL + API_URL="${{ steps.health.outputs.working_api_url }}" DRY_RUN="${{ github.event.inputs.dry_run || 'true' }}" echo "🎯 執行 E2E Tool Call Verification v2.0" - echo " API: $API_URL" + echo " API: $API_URL (verified working)" echo " Dry Run: $DRY_RUN" if [ "$DRY_RUN" = "true" ]; then