Try again, again, again...
This commit is contained in:
27
.github/workflows/integration-tests.yml
vendored
27
.github/workflows/integration-tests.yml
vendored
@@ -55,11 +55,25 @@ jobs:
|
||||
# Give it one more second to fully initialize
|
||||
sleep 2
|
||||
|
||||
- name: Debug network connectivity
|
||||
- name: Get PostgreSQL connection details
|
||||
id: pg_connection
|
||||
run: |
|
||||
echo "=== Checking port on host ==="
|
||||
ss -tlnp | grep 5439 || netstat -tlnp | grep 5439 || lsof -i :5439 || echo "Checking with docker..."
|
||||
docker port relspec-test-postgres
|
||||
# Get container IP address
|
||||
CONTAINER_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' relspec-test-postgres)
|
||||
echo "Container IP: $CONTAINER_IP"
|
||||
|
||||
# If container IP exists, use it with port 5432 (internal port)
|
||||
# Otherwise fall back to localhost:5439
|
||||
if [ -n "$CONTAINER_IP" ]; then
|
||||
echo "Using container IP: $CONTAINER_IP:5432"
|
||||
echo "pg_host=$CONTAINER_IP" >> $GITHUB_OUTPUT
|
||||
echo "pg_port=5432" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "Using localhost:5439"
|
||||
echo "pg_host=localhost" >> $GITHUB_OUTPUT
|
||||
echo "pg_port=5439" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=== Testing connection from inside container ==="
|
||||
docker exec relspec-test-postgres psql -U relspec -d relspec_test -c "SELECT version();"
|
||||
@@ -81,9 +95,10 @@ jobs:
|
||||
|
||||
- name: Test Go connection to PostgreSQL
|
||||
env:
|
||||
RELSPEC_TEST_PG_CONN: postgres://relspec:relspec_test_password@localhost:5439/relspec_test
|
||||
RELSPEC_TEST_PG_CONN: postgres://relspec:relspec_test_password@${{ steps.pg_connection.outputs.pg_host }}:${{ steps.pg_connection.outputs.pg_port }}/relspec_test
|
||||
run: |
|
||||
echo "Testing connection using Go (same as integration tests will use)..."
|
||||
echo "Connection string: postgres://relspec:***@${{ steps.pg_connection.outputs.pg_host }}:${{ steps.pg_connection.outputs.pg_port }}/relspec_test"
|
||||
mkdir -p /tmp/testconn
|
||||
cat > /tmp/testconn/test_conn.go << 'EOF'
|
||||
package main
|
||||
@@ -113,7 +128,7 @@ jobs:
|
||||
|
||||
- name: Run integration tests
|
||||
env:
|
||||
RELSPEC_TEST_PG_CONN: postgres://relspec:relspec_test_password@localhost:5439/relspec_test
|
||||
RELSPEC_TEST_PG_CONN: postgres://relspec:relspec_test_password@${{ steps.pg_connection.outputs.pg_host }}:${{ steps.pg_connection.outputs.pg_port }}/relspec_test
|
||||
run: make test-integration
|
||||
|
||||
- name: Stop PostgreSQL container
|
||||
|
||||
Reference in New Issue
Block a user