From ac53d42a0af4c035a11cb940bfad6e42be444e6c Mon Sep 17 00:00:00 2001 From: Hong Jiarong Date: Thu, 30 Jul 2026 13:00:58 +0800 Subject: [PATCH] fix(hub): honor DATABASE_URL in integration test helpers CI hub-check reaches Postgres as the service hostname `postgres`, but helpers hard-coded 127.0.0.1:5432, so migrate ran against the service while vitest connected to the wrong place. Prefer env when set. --- hub/test/integration/helpers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hub/test/integration/helpers.ts b/hub/test/integration/helpers.ts index aca8e73..dd941d2 100644 --- a/hub/test/integration/helpers.ts +++ b/hub/test/integration/helpers.ts @@ -19,7 +19,9 @@ import type { FeishuRuntime } from "../../src/feishu/client.js"; import type { ModelFactory } from "../../src/agent/runner.js"; import { LocalSecretEnvelope } from "../../src/security/secretEnvelope.js"; -export const TEST_DATABASE_URL = "postgresql://paradigm:paradigm@127.0.0.1:5432/cph_hub_test"; +export const TEST_DATABASE_URL = + process.env.DATABASE_URL?.trim() || + "postgresql://paradigm:paradigm@127.0.0.1:5432/cph_hub_test"; export const DEFAULT_ORG_ID = "org_test_default"; export const TEST_SECRET_KEY_ID = "test-active"; export const TEST_SECRET_KEY = Buffer.alloc(32, "k");