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: |
|
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,
|
||||||
|
|||||||
Reference in New Issue
Block a user