From beb1100d862ce2588f0d329313e3e240b0a79554 Mon Sep 17 00:00:00 2001 From: Hein Date: Sun, 28 Dec 2025 16:07:28 +0200 Subject: [PATCH] Another integration test try --- .github/workflows/integration-tests.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 7110dbb..ba47776 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -35,17 +35,20 @@ jobs: run: | docker run -d \ --name relspec-test-postgres \ + --network host \ -e POSTGRES_USER=relspec \ -e POSTGRES_PASSWORD=relspec_test_password \ -e POSTGRES_DB=relspec_test \ - -p 5439:5432 \ - postgres:16-alpine + -e POSTGRES_HOST_AUTH_METHOD=trust \ + -e PGPORT=5439 \ + postgres:16-alpine \ + -p 5439 - name: Wait for PostgreSQL to be ready run: | echo "Waiting for PostgreSQL to be ready..." 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!" break fi @@ -54,15 +57,17 @@ jobs: done # Give it one more second to fully initialize 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 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 run: | 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 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,