Skip to content

Commit 2c8c8d8

Browse files
committed
chore: add e2e tests CI
1 parent 9e8737f commit 2c8c8d8

3 files changed

Lines changed: 84 additions & 2 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
env:
11+
REPLANE_SUPERADMIN_API_KEY: test-superuser-api-key-for-e2e
12+
REPLANE_ADMIN_API_PORT: 8084
13+
REPLANE_EDGE_API_PORT: 8085
14+
15+
jobs:
16+
e2e:
17+
name: E2E Tests
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 15
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup pnpm
26+
uses: pnpm/action-setup@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 22
32+
cache: pnpm
33+
34+
- name: Install dependencies
35+
run: pnpm install --frozen-lockfile
36+
37+
- name: Build packages
38+
run: pnpm run build
39+
40+
- name: Start services
41+
working-directory: packages/test-suite
42+
run: |
43+
docker compose up -d
44+
# Wait for services to be healthy
45+
echo "Waiting for services to be ready..."
46+
sleep 10
47+
# Check if services are up
48+
for i in {1..30}; do
49+
if curl -sf http://localhost:$REPLANE_ADMIN_API_PORT/api/health > /dev/null 2>&1; then
50+
echo "Admin API is ready"
51+
break
52+
fi
53+
echo "Waiting for Admin API... ($i/30)"
54+
sleep 2
55+
done
56+
for i in {1..30}; do
57+
if curl -sf http://localhost:$REPLANE_EDGE_API_PORT/api/health > /dev/null 2>&1; then
58+
echo "Edge API is ready"
59+
break
60+
fi
61+
echo "Waiting for Edge API... ($i/30)"
62+
sleep 2
63+
done
64+
65+
- name: Run E2E tests
66+
working-directory: packages/test-suite
67+
env:
68+
REPLANE_ADMIN_API_BASE_URL: http://localhost:${{ env.REPLANE_ADMIN_API_PORT }}
69+
REPLANE_EDGE_API_BASE_URL: http://localhost:${{ env.REPLANE_EDGE_API_PORT }}
70+
run: pnpm test:e2e
71+
72+
- name: Show logs on failure
73+
if: failure()
74+
working-directory: packages/test-suite
75+
run: docker compose logs
76+
77+
- name: Cleanup
78+
if: always()
79+
working-directory: packages/test-suite
80+
run: docker compose down -v
81+

packages/svelte/examples/basic/src/App.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@
6363
</ReplaneContext>
6464

6565
{#snippet failed(error)}
66+
{@const errorMessage = error instanceof Error ? error.message : String(error)}
6667
<div class="loading-screen">
67-
<p>Error loading configuration: {error.message}</p>
68+
<p>Error loading configuration: {errorMessage}</p>
6869
</div>
6970
{/snippet}
7071
</svelte:boundary>

packages/test-suite/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
x-replane-common: &replane-common
2-
image: replane/replane:latest
2+
image: ghcr.io/replane-dev/replane:latest
33
depends_on:
44
postgres:
55
condition: service_healthy

0 commit comments

Comments
 (0)