|
| 1 | +# |
| 2 | +# GitHub Action: E2E Tests |
| 3 | +# |
| 4 | +# This workflow is triggered on pushes to main and renovate branches, as well as |
| 5 | +# pull requests. It runs E2E Tests to ensure the code is working. |
| 6 | +# |
1 | 7 | name: E2E Tests |
2 | 8 |
|
3 | 9 | on: |
|
7 | 13 | - 'renovate/**' |
8 | 14 | pull_request: |
9 | 15 |
|
| 16 | +env: |
| 17 | + # Required environment variables for the E2E test |
| 18 | + GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} |
| 19 | + OPENAI_API_KEY: PLACEHOLDER |
| 20 | + |
10 | 21 | jobs: |
11 | | - test-e2e: |
| 22 | + test: |
12 | 23 | name: Run on Ubuntu |
13 | 24 | runs-on: ubuntu-latest |
14 | | - permissions: |
15 | | - contents: 'read' |
| 25 | + |
| 26 | + defaults: |
| 27 | + run: |
| 28 | + working-directory: testworkflows |
16 | 29 |
|
17 | 30 | steps: |
18 | 31 | - name: Clone the code |
19 | | - uses: actions/checkout@v5 |
| 32 | + uses: 'actions/checkout@v5' |
| 33 | + |
| 34 | + - name: Install uv |
| 35 | + uses: 'astral-sh/setup-uv@v6' |
| 36 | + with: |
| 37 | + version: "0.8.17" |
| 38 | + enable-cache: true |
20 | 39 |
|
21 | | - - name: Setup Go |
22 | | - uses: actions/setup-go@v6 |
| 40 | + - name: Setup Python |
| 41 | + uses: 'actions/setup-python@v6' |
23 | 42 | with: |
24 | | - go-version-file: go.mod |
| 43 | + python-version-file: "testworkflows/.python-version" |
| 44 | + |
| 45 | + - name: Install Dependencies |
| 46 | + run: uv sync |
25 | 47 |
|
26 | | - - name: Install the latest version of kind |
| 48 | + - name: Set up Kubernetes (kind) |
| 49 | + uses: 'helm/kind-action@v1' |
| 50 | + with: |
| 51 | + cluster_name: testbench-cluster |
| 52 | + |
| 53 | + - name: Install Tilt |
27 | 54 | run: | |
28 | | - curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64 |
29 | | - chmod +x ./kind |
30 | | - sudo mv ./kind /usr/local/bin/kind |
| 55 | + curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash |
| 56 | + tilt version |
31 | 57 |
|
32 | | - - name: Verify kind installation |
33 | | - run: kind version |
| 58 | + - name: Start test data server |
| 59 | + run: uv run python -m http.server 8000 --directory tests/test_data & |
34 | 60 |
|
35 | | - - name: Running Test e2e |
| 61 | + - name: Start Tiltfile services |
| 62 | + run: tilt ci |
| 63 | + working-directory: . |
| 64 | + |
| 65 | + - name: Wait for services to be ready |
36 | 66 | run: | |
37 | | - go mod tidy |
38 | | - make test-e2e |
| 67 | + echo "Waiting for services to be ready..." |
| 68 | + kubectl wait --for=condition=ready pod -l app=weather-agent --timeout=300s || true |
| 69 | + kubectl wait --for=condition=ready pod -l app=ai-gateway-litellm --timeout=300s || true |
| 70 | + kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=lgtm --timeout=300s || true |
| 71 | + |
| 72 | + echo "Checking service status..." |
| 73 | + kubectl get pods -A |
| 74 | + |
| 75 | + echo "Waiting for test-data-server (HTTP server on port 8000)..." |
| 76 | + curl --retry 30 --retry-delay 2 --retry-connrefused -f http://localhost:8000/dataset.json > /dev/null |
| 77 | +
|
| 78 | + - name: Running Test e2e |
| 79 | + run: uv run poe test_e2e |
0 commit comments