Updated tests
Some checks failed
CI / Test (1.24) (push) Successful in -24m27s
CI / Test (1.25) (push) Successful in -24m28s
CI / Build (push) Successful in -25m56s
CI / Lint (push) Failing after -25m35s
Integration Tests / Integration Tests (push) Failing after -25m38s

This commit is contained in:
2025-12-28 14:35:20 +02:00
parent beb5b4fac8
commit 2a271b9859
3 changed files with 81 additions and 27 deletions

View File

@@ -11,21 +11,6 @@ jobs:
name: Integration Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: relspec
POSTGRES_PASSWORD: relspec_test_password
POSTGRES_DB: relspec_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -46,6 +31,29 @@ jobs:
- name: Download dependencies
run: go mod download
- name: Start PostgreSQL container
run: |
docker run -d \
--name relspec-test-postgres \
-e POSTGRES_USER=relspec \
-e POSTGRES_PASSWORD=relspec_test_password \
-e POSTGRES_DB=relspec_test \
-p 5432:5432 \
postgres:16-alpine
- name: Wait for PostgreSQL to be ready
run: |
echo "Waiting for PostgreSQL to start..."
for i in {1..30}; do
if docker exec relspec-test-postgres pg_isready -U relspec -d relspec_test > /dev/null 2>&1; then
echo "PostgreSQL is ready!"
break
fi
echo "Waiting... ($i/30)"
sleep 1
done
sleep 2
- name: Install PostgreSQL client
run: |
sudo apt-get update
@@ -75,8 +83,14 @@ jobs:
RELSPEC_TEST_PG_CONN: postgres://relspec:relspec_test_password@localhost:5432/relspec_test
run: make test-integration
- name: Stop PostgreSQL container
if: always()
run: |
docker stop relspec-test-postgres || true
docker rm relspec-test-postgres || true
- name: Summary
if: always()
run: |
echo "Integration tests completed."
echo "PostgreSQL service was running on localhost:5432"
echo "PostgreSQL container has been cleaned up."