Another integration test try
Some checks failed
CI / Test (1.24) (push) Successful in 45s
CI / Lint (push) Successful in -25m51s
CI / Test (1.25) (push) Successful in -25m45s
CI / Build (push) Successful in 31s
Integration Tests / Integration Tests (push) Failing after -25m59s

This commit is contained in:
2025-12-28 16:07:28 +02:00
parent 410b1ee743
commit beb1100d86

View File

@@ -35,17 +35,20 @@ jobs:
run: | run: |
docker run -d \ docker run -d \
--name relspec-test-postgres \ --name relspec-test-postgres \
--network host \
-e POSTGRES_USER=relspec \ -e POSTGRES_USER=relspec \
-e POSTGRES_PASSWORD=relspec_test_password \ -e POSTGRES_PASSWORD=relspec_test_password \
-e POSTGRES_DB=relspec_test \ -e POSTGRES_DB=relspec_test \
-p 5439:5432 \ -e POSTGRES_HOST_AUTH_METHOD=trust \
postgres:16-alpine -e PGPORT=5439 \
postgres:16-alpine \
-p 5439
- name: Wait for PostgreSQL to be ready - name: Wait for PostgreSQL to be ready
run: | run: |
echo "Waiting for PostgreSQL to be ready..." echo "Waiting for PostgreSQL to be ready..."
for i in {1..30}; do for i in {1..30}; do
if docker exec relspec-test-postgres pg_isready -U relspec -d relspec_test > /dev/null 2>&1; then if docker exec relspec-test-postgres pg_isready -U relspec -d relspec_test -p 5439 > /dev/null 2>&1; then
echo "PostgreSQL is ready!" echo "PostgreSQL is ready!"
break break
fi fi
@@ -54,15 +57,17 @@ jobs:
done done
# Give it one more second to fully initialize # Give it one more second to fully initialize
sleep 2 sleep 2
echo "Testing connection from host..."
docker exec relspec-test-postgres psql -U relspec -d relspec_test -p 5439 -c "SELECT version();" || echo "Warning: Connection test failed"
- name: Initialize test database - name: Initialize test database
run: | run: |
docker exec -i relspec-test-postgres psql -U relspec -d relspec_test < tests/postgres/init.sql docker exec -i relspec-test-postgres psql -U relspec -d relspec_test -p 5439 < tests/postgres/init.sql
- name: Verify database setup - name: Verify database setup
run: | run: |
echo "Verifying database initialization..." echo "Verifying database initialization..."
docker exec relspec-test-postgres psql -U relspec -d relspec_test -c " docker exec relspec-test-postgres psql -U relspec -d relspec_test -p 5439 -c "
SELECT SELECT
(SELECT COUNT(*) FROM pg_namespace WHERE nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') AND nspname NOT LIKE 'pg_%') as schemas, (SELECT COUNT(*) FROM pg_namespace WHERE nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') AND nspname NOT LIKE 'pg_%') as schemas,
(SELECT COUNT(*) FROM pg_tables WHERE schemaname NOT IN ('pg_catalog', 'information_schema')) as tables, (SELECT COUNT(*) FROM pg_tables WHERE schemaname NOT IN ('pg_catalog', 'information_schema')) as tables,