@@ -59,32 +59,58 @@ jobs:
5959 - name : Download dependencies
6060 run : go mod download
6161
62- - name : Start PostgreSQL with logical replication
62+ - name : Create Docker network
63+ run : docker network create wal-test-network
64+
65+ - name : Start primary PostgreSQL (upstream)
6366 run : |
6467 docker run -d \
65- --name postgres-test \
68+ --name postgres-primary \
69+ --network wal-test-network \
6670 -e POSTGRES_USER=postgres \
6771 -e POSTGRES_PASSWORD=postgres \
6872 -e POSTGRES_DB=postgres \
6973 -p 5432:5432 \
7074 postgres:17 \
7175 -c wal_level=logical \
72- -c max_wal_senders=10 \
73- -c max_replication_slots=10
76+ -c max_wal_senders=20 \
77+ -c max_replication_slots=20
78+
79+ - name : Start downstream PostgreSQL (for foreign origin testing)
80+ run : |
81+ docker run -d \
82+ --name postgres-downstream \
83+ --network wal-test-network \
84+ -e POSTGRES_USER=postgres \
85+ -e POSTGRES_PASSWORD=postgres \
86+ -e POSTGRES_DB=postgres \
87+ -p 5433:5432 \
88+ postgres:17 \
89+ -c wal_level=logical \
90+ -c max_wal_senders=20 \
91+ -c max_replication_slots=20
7492
75- - name : Wait for PostgreSQL to be ready
93+ - name : Wait for PostgreSQL instances to be ready
7694 run : |
7795 for i in {1..30}; do
78- docker exec postgres-test pg_isready -U postgres && break
79- echo "Waiting for PostgreSQL..."
96+ docker exec postgres-primary pg_isready -U postgres && break
97+ echo "Waiting for primary PostgreSQL..."
98+ sleep 2
99+ done
100+ for i in {1..30}; do
101+ docker exec postgres-downstream pg_isready -U postgres && break
102+ echo "Waiting for downstream PostgreSQL..."
80103 sleep 2
81104 done
82105
83106 - name : Verify PostgreSQL configuration
84107 run : |
85- docker exec postgres-test psql -U postgres -c "SHOW wal_level;"
86- docker exec postgres-test psql -U postgres -c "SHOW max_replication_slots;"
87- docker exec postgres-test psql -U postgres -c "SHOW max_wal_senders;"
108+ echo "=== Primary PostgreSQL ==="
109+ docker exec postgres-primary psql -U postgres -c "SHOW wal_level;"
110+ docker exec postgres-primary psql -U postgres -c "SHOW max_replication_slots;"
111+ echo "=== Downstream PostgreSQL ==="
112+ docker exec postgres-downstream psql -U postgres -c "SHOW wal_level;"
113+ docker exec postgres-downstream psql -U postgres -c "SHOW max_replication_slots;"
88114
89115 - name : Run integration tests
90116 env :
93119 POSTGRES_USER : postgres
94120 POSTGRES_PASSWORD : postgres
95121 POSTGRES_DB : postgres
122+ POSTGRES_DOWNSTREAM_HOST : localhost
123+ POSTGRES_DOWNSTREAM_PORT : 5433
124+ # Internal hostnames for container-to-container communication (used by subscriptions)
125+ POSTGRES_PRIMARY_HOST_INTERNAL : postgres-primary
126+ POSTGRES_PRIMARY_PORT_INTERNAL : 5432
96127 run : go test -v -tags=integration -timeout=300s ./listener/...
0 commit comments