Skip to content

Commit bf37f76

Browse files
committed
Implement end-to-end tests for sync feature
Implement end-to-end tests for sync feature Implement end-to-end tests for sync feature chore: revert pnpm-lock.yaml to match query-driven-sync chore: update pnpm-lock.yaml with e2e test pg dependencies bump pnpm/action-setup version fix pnpmlockfile format only run normal tests on test command tidy and fix types fixes ci fix tidy checkpoint cleanup between each test add cleanup between tests all e2e tests pass! cleanup live queries fixes for ci add propper mutations to e2e tests fix ci timouts move the badly named accumulated data tests fix ci flake
1 parent 685af96 commit bf37f76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5790
-62
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches: [main, query-driven-sync]
6+
pull_request:
7+
branches: [main, query-driven-sync]
8+
9+
jobs:
10+
e2e-tests:
11+
name: Run E2E Tests
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 10
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup pnpm
20+
uses: pnpm/action-setup@v4
21+
with:
22+
version: 10.19.0
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: "20"
28+
cache: "pnpm"
29+
30+
- name: Install dependencies
31+
run: pnpm install --frozen-lockfile
32+
33+
- name: Start Docker services
34+
run: |
35+
cd packages/db-collection-e2e/docker
36+
docker compose up -d
37+
echo "Waiting for services to be healthy..."
38+
timeout 60 bash -c 'until docker compose ps | grep -q "healthy"; do sleep 2; done'
39+
40+
- name: Build packages
41+
run: |
42+
pnpm --filter @tanstack/db-ivm build
43+
pnpm --filter @tanstack/db build
44+
pnpm --filter @tanstack/electric-db-collection build
45+
pnpm --filter @tanstack/query-db-collection build
46+
47+
- name: Run Electric E2E tests
48+
run: |
49+
cd packages/electric-db-collection
50+
pnpm test:e2e
51+
env:
52+
ELECTRIC_URL: http://localhost:3000
53+
POSTGRES_HOST: localhost
54+
POSTGRES_PORT: 54321
55+
POSTGRES_USER: postgres
56+
POSTGRES_PASSWORD: password
57+
POSTGRES_DB: e2e_test
58+
59+
- name: Run Query E2E tests
60+
run: |
61+
cd packages/query-db-collection
62+
pnpm test:e2e
63+
env:
64+
ELECTRIC_URL: http://localhost:3000
65+
66+
- name: Stop Docker services
67+
if: always()
68+
run: |
69+
cd packages/db-collection-e2e/docker
70+
docker compose down -v
71+
72+
- name: Upload test results
73+
if: failure()
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: test-results
77+
path: packages/db-collection-e2e/junit/
78+
retention-days: 7

0 commit comments

Comments
 (0)