|
| 1 | +name: Integration Test [Kubernetes] |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + workflow_dispatch: # Allow manual triggering |
| 11 | + |
| 12 | +jobs: |
| 13 | + integration-test: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + timeout-minutes: 60 |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Check out the repo |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Set up Go |
| 22 | + uses: actions/setup-go@v5 |
| 23 | + with: |
| 24 | + go-version: '1.24' |
| 25 | + |
| 26 | + - name: Set up Rust |
| 27 | + uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 28 | + with: |
| 29 | + toolchain: 1.90 |
| 30 | + |
| 31 | + - name: Install system dependencies |
| 32 | + run: | |
| 33 | + sudo apt-get update |
| 34 | + sudo apt-get install -y \ |
| 35 | + make \ |
| 36 | + curl \ |
| 37 | + build-essential \ |
| 38 | + pkg-config |
| 39 | +
|
| 40 | + - name: Install Kind |
| 41 | + run: | |
| 42 | + curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-amd64 |
| 43 | + chmod +x ./kind |
| 44 | + sudo mv ./kind /usr/local/bin/kind |
| 45 | +
|
| 46 | + - name: Install kubectl |
| 47 | + run: | |
| 48 | + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" |
| 49 | + chmod +x kubectl |
| 50 | + sudo mv kubectl /usr/local/bin/kubectl |
| 51 | +
|
| 52 | + - name: Install Helm |
| 53 | + run: | |
| 54 | + curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash |
| 55 | +
|
| 56 | + - name: Download E2E test dependencies |
| 57 | + run: | |
| 58 | + cd e2e && go mod download |
| 59 | +
|
| 60 | + - name: Build E2E test binary |
| 61 | + run: | |
| 62 | + make build-e2e |
| 63 | +
|
| 64 | + - name: Run Integration E2E tests |
| 65 | + id: e2e-test |
| 66 | + run: | |
| 67 | + set +e # Don't exit on error, we want to capture the result |
| 68 | + make e2e-test E2E_PROFILE=ai-gateway E2E_VERBOSE=true E2E_KEEP_CLUSTER=false |
| 69 | + TEST_EXIT_CODE=$? |
| 70 | + echo "test_exit_code=${TEST_EXIT_CODE}" >> $GITHUB_OUTPUT |
| 71 | + exit ${TEST_EXIT_CODE} |
| 72 | +
|
| 73 | + - name: Upload test reports |
| 74 | + if: always() |
| 75 | + uses: actions/upload-artifact@v4 |
| 76 | + with: |
| 77 | + name: test-reports |
| 78 | + path: | |
| 79 | + test-report.json |
| 80 | + test-report.md |
| 81 | + semantic-router-logs.txt |
| 82 | + retention-days: 30 |
| 83 | + |
| 84 | + - name: Create test summary from report |
| 85 | + if: always() |
| 86 | + run: | |
| 87 | + if [ -f "test-report.md" ]; then |
| 88 | + echo "=== Reading test report from test-report.md ===" |
| 89 | + cat test-report.md >> $GITHUB_STEP_SUMMARY |
| 90 | +
|
| 91 | + # Add semantic-router logs section if available |
| 92 | + if [ -f "semantic-router-logs.txt" ]; then |
| 93 | + cat >> $GITHUB_STEP_SUMMARY << 'EOF' |
| 94 | +
|
| 95 | + --- |
| 96 | +
|
| 97 | + ### 📝 Semantic Router Logs |
| 98 | +
|
| 99 | + <details> |
| 100 | + <summary>Click to view semantic-router logs</summary> |
| 101 | +
|
| 102 | + ``` |
| 103 | + EOF |
| 104 | + # Add first 500 lines of logs to summary (to avoid exceeding GitHub limits) |
| 105 | + head -n 500 semantic-router-logs.txt >> $GITHUB_STEP_SUMMARY |
| 106 | +
|
| 107 | + # Check if there are more lines |
| 108 | + TOTAL_LINES=$(wc -l < semantic-router-logs.txt) |
| 109 | + if [ "$TOTAL_LINES" -gt 500 ]; then |
| 110 | + cat >> $GITHUB_STEP_SUMMARY << EOF |
| 111 | +
|
| 112 | + ... (showing first 500 lines of $TOTAL_LINES total lines) |
| 113 | +
|
| 114 | + 📦 Full logs are available in the workflow artifacts: semantic-router-logs.txt |
| 115 | + EOF |
| 116 | + fi |
| 117 | +
|
| 118 | + cat >> $GITHUB_STEP_SUMMARY << 'EOF' |
| 119 | + ``` |
| 120 | +
|
| 121 | + </details> |
| 122 | + EOF |
| 123 | + fi |
| 124 | +
|
| 125 | + # Add additional context |
| 126 | + cat >> $GITHUB_STEP_SUMMARY << 'EOF' |
| 127 | +
|
| 128 | + --- |
| 129 | +
|
| 130 | + ### 📚 Additional Resources |
| 131 | +
|
| 132 | + - **Trigger:** ${{ github.event_name }} |
| 133 | + - **Branch:** `${{ github.ref_name }}` |
| 134 | + - **Commit:** `${{ github.sha }}` |
| 135 | + - **Workflow Run:** [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) |
| 136 | + - [E2E Test Framework Documentation](https://github.com/${{ github.repository }}/tree/main/e2e) |
| 137 | + - [AI Gateway Profile](https://github.com/${{ github.repository }}/tree/main/e2e/profiles/ai-gateway) |
| 138 | +
|
| 139 | + ### 📦 Artifacts |
| 140 | +
|
| 141 | + - **test-report.json** - Detailed test results in JSON format |
| 142 | + - **test-report.md** - Human-readable test report |
| 143 | + - **semantic-router-logs.txt** - Complete semantic-router pod logs |
| 144 | + - All artifacts are retained for 30 days |
| 145 | + EOF |
| 146 | + else |
| 147 | + echo "⚠️ Test report file not found!" >> $GITHUB_STEP_SUMMARY |
| 148 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 149 | + echo "The E2E test framework did not generate a report file." >> $GITHUB_STEP_SUMMARY |
| 150 | + echo "This might indicate that the test failed before report generation." >> $GITHUB_STEP_SUMMARY |
| 151 | + fi |
| 152 | +
|
| 153 | + - name: Clean up |
| 154 | + if: always() |
| 155 | + run: | |
| 156 | + make e2e-cleanup || true |
| 157 | +
|
0 commit comments