-
Notifications
You must be signed in to change notification settings - Fork 492
153 lines (133 loc) · 5.13 KB
/
nightly-e2e-test-suite.yml
File metadata and controls
153 lines (133 loc) · 5.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Nightly E2E Test Suite
on:
schedule:
# Run at 6:00 AM UTC Monday-Friday
- cron: '0 6 * * 1-5'
push:
branches:
- nightly/*
workflow_dispatch: # Allow manual triggering
jobs:
nightly-e2e-tests:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
cache-dependency-path: "yarn.lock"
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn install
- name: Setup Supabase CLI
uses: supabase/setup-cli@v1
with:
version: latest
- name: Start Clickhouse and Minio
run: cd docker && docker compose up minio minio-setup clickhouse -d
- name: Start Supabase
run: |
echo 'y' | npx supabase start -x realtime,storage-api,imgproxy,mailpit,edge-runtime,logflare,vector,supavisor
- name: Start Gateway Workers
run: |
cd worker
yarn install
mkdir -p logs
echo "Starting HELICONE_API worker on port 8788..."
npx wrangler dev --var WORKER_TYPE:HELICONE_API --port 8788 --inspector-port=9240 > logs/wrangler-helicone-api.log 2>&1 &
echo $! > logs/wrangler-helicone-api.pid
echo "Starting AI_GATEWAY_API worker on port 8793..."
npx wrangler dev --var WORKER_TYPE:AI_GATEWAY_API --var HELICONE_ORG_ID:"a75d76e3-02e7-4d02-8a2b-c65ed27c69b2" --port 8793 --inspector-port=9241 > logs/wrangler-ai-gateway.log 2>&1 &
echo $! > logs/wrangler-ai-gateway.pid
echo "Waiting for workers to start..."
sleep 10
- name: Health Check Workers
run: |
echo "Checking if workers are running..."
MAX_RETRIES=30
RETRY_DELAY=2
# Check HELICONE_API worker (port 8788)
for i in $(seq 1 $MAX_RETRIES); do
if curl -f http://localhost:8788/healthcheck 2>/dev/null; then
echo "✓ HELICONE_API worker is running on port 8788"
break
fi
if [ $i -eq $MAX_RETRIES ]; then
echo "✗ HELICONE_API worker failed to start on port 8788"
echo "Last 50 lines of wrangler-helicone-api.log:"
tail -50 worker/logs/wrangler-helicone-api.log || true
exit 1
fi
echo "Waiting for HELICONE_API worker... (attempt $i/$MAX_RETRIES)"
sleep $RETRY_DELAY
done
# Check AI_GATEWAY_API worker (port 8793)
for i in $(seq 1 $MAX_RETRIES); do
if curl -f http://localhost:8793/healthcheck 2>/dev/null; then
echo "✓ AI_GATEWAY_API worker is running on port 8793"
break
fi
if [ $i -eq $MAX_RETRIES ]; then
echo "✗ AI_GATEWAY_API worker failed to start on port 8793"
echo "Last 50 lines of wrangler-ai-gateway.log:"
tail -50 worker/logs/wrangler-ai-gateway.log || true
exit 1
fi
echo "Waiting for AI_GATEWAY_API worker... (attempt $i/$MAX_RETRIES)"
sleep $RETRY_DELAY
done
echo "All workers are running!"
- name: Start Jawn
run: |
cd valhalla/jawn
cp .env.hosted.example .env
yarn install
yarn dev &
sleep 10
- name: Setup Python for populate-keys
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Populate Provider API Keys
env:
PRODUCTION_PROVIDER_API_KEYS: ${{ secrets.PRODUCTION_PROVIDER_API_KEYS }}
run: |
pip install requests
python scripts/populate-keys/main.py
- name: Run E2E Tests
run: |
cd e2e
yarn install
# Run regular tests (excluding nightly)
yarn test
# Run nightly tests explicitly
yarn test tests/nightly
- name: Display Logs on Failure
if: failure()
run: |
echo "========================================="
echo "HELICONE_API Worker Logs (last 100 lines)"
echo "========================================="
tail -100 worker/logs/wrangler-helicone-api.log || echo "No logs found for HELICONE_API worker"
echo ""
echo "========================================="
echo "AI_GATEWAY_API Worker Logs (last 100 lines)"
echo "========================================="
tail -100 worker/logs/wrangler-ai-gateway.log || echo "No logs found for AI_GATEWAY_API worker"
echo ""
echo "========================================="
echo "Worker Process Status"
echo "========================================="
ps aux | grep wrangler || echo "No wrangler processes found"
- name: Cleanup
if: always()
run: |
pkill -f wrangler || true
pkill -f "yarn dev" || true
supabase stop --no-backup || true
cd docker && docker compose down || true