Another integration test try
This commit is contained in:
15
.github/workflows/integration-tests.yml
vendored
15
.github/workflows/integration-tests.yml
vendored
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user