Skip to content

Commit 6c1eddf

Browse files
AchoArnoldCopilot
andcommitted
ci: run hedging integration test in GitHub Actions
Wait for sqld health before running tests. Set TEST_DATABASE_URL and TEST_TURSO_DATABASE_URL env vars pointing to docker compose services. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4263fda commit 6c1eddf

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/api.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ jobs:
3737
- name: Wait for services to be healthy
3838
working-directory: ./tests
3939
run: |
40+
echo "Waiting for sqld to be healthy..."
41+
for i in $(seq 1 20); do
42+
if curl -sf http://localhost:8090/health >/dev/null 2>&1; then
43+
echo "sqld is healthy!"
44+
break
45+
fi
46+
if [ $i -eq 20 ]; then
47+
echo "sqld failed to become healthy"
48+
docker compose logs sqld
49+
exit 1
50+
fi
51+
echo "sqld attempt $i/20 - waiting 3s..."
52+
sleep 3
53+
done
54+
4055
echo "Waiting for API to be healthy..."
4156
for i in $(seq 1 40); do
4257
if docker compose exec api curl -sf http://localhost:8000/health >/dev/null 2>&1; then
@@ -59,6 +74,13 @@ jobs:
5974
docker compose wait seed || true
6075
sleep 2
6176
77+
- name: Run Hedging Repository Integration Tests
78+
working-directory: ./api
79+
env:
80+
TEST_DATABASE_URL: postgresql://dbusername:dbpassword@localhost:5435/httpsms
81+
TEST_TURSO_DATABASE_URL: http://localhost:8090
82+
run: go test -vet=off -v -timeout 120s -run TestHedging ./pkg/repositories/
83+
6284
- name: Run Integration Tests
6385
working-directory: ./tests
6486
run: go test -v -timeout 300s ./...

0 commit comments

Comments
 (0)