forked from EduCraft/curriculum-project-hub
fix(ci): bind hub-check Postgres on host 15432
Runner host 5432 is already allocated (leftover containers), causing hub-check service Postgres to fail start. Map service DB to 15432 and point wait/integration DATABASE_URL at that port.
This commit is contained in:
@@ -21,7 +21,8 @@ jobs:
|
||||
POSTGRES_PASSWORD: paradigm
|
||||
POSTGRES_DB: cph_hub_test
|
||||
ports:
|
||||
- 5432:5432
|
||||
# Host 15432 avoids collisions with any runner-local Postgres on 5432.
|
||||
- 15432:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U paradigm -d cph_hub_test"
|
||||
--health-interval 5s
|
||||
@@ -53,9 +54,9 @@ jobs:
|
||||
run: |
|
||||
node <<'NODE'
|
||||
const net = require("node:net");
|
||||
const deadline = Date.now() + 60000;
|
||||
const port = Number(process.env.HUB_CHECK_PG_PORT || "15432");
|
||||
function tryConnect() {
|
||||
const socket = net.createConnection({ host: "127.0.0.1", port: 5432 });
|
||||
const socket = net.createConnection({ host: "127.0.0.1", port });
|
||||
socket.once("connect", () => {
|
||||
socket.end();
|
||||
process.exit(0);
|
||||
@@ -63,7 +64,7 @@ jobs:
|
||||
socket.once("error", () => {
|
||||
socket.destroy();
|
||||
if (Date.now() > deadline) {
|
||||
console.error("Postgres did not become reachable at 127.0.0.1:5432");
|
||||
console.error(`Postgres did not become reachable at 127.0.0.1:${port}`);
|
||||
process.exit(1);
|
||||
}
|
||||
setTimeout(tryConnect, 1000);
|
||||
@@ -110,7 +111,7 @@ jobs:
|
||||
--exclude test/integration/real-model.test.ts \
|
||||
--exclude test/integration/agent-sandbox-linux.test.ts
|
||||
env:
|
||||
DATABASE_URL: postgresql://paradigm:paradigm@127.0.0.1:5432/cph_hub_test
|
||||
DATABASE_URL: postgresql://paradigm:paradigm@127.0.0.1:15432/cph_hub_test
|
||||
|
||||
# Real-model tests are opt-in: set RUN_REAL_MODEL_TESTS=true and provide
|
||||
# OPENROUTER_API_KEY when a branch should hit live OpenRouter.
|
||||
|
||||
Reference in New Issue
Block a user