MCPcopy Create free account
hub / github.com/Haidra-Org/AI-Horde / configure_postgres

Function configure_postgres

tests/dependency_runtime.py:285–300  ·  view source on GitHub ↗
(runtime: HordeTestRuntime)

Source from the content-addressed store, hash-verified

283
284
285def configure_postgres(runtime: HordeTestRuntime) -> None:
286 external_dsn = resolve_postgres_dsn()
287 if postgres_reachable(external_dsn):
288 runtime.postgres_dsn = external_dsn
289 return
290
291 if runtime.deps_mode == EXTERNAL_DEPS_MODE:
292 runtime.postgres_skip_reason = (
293 f"Postgres unreachable at {external_dsn!r}. Provide an external test database or rerun with {DEPS_MODE_ENV}={AUTO_DEPS_MODE}."
294 )
295 return
296
297 try:
298 start_managed_postgres(runtime)
299 except Exception as raised_exc: # pragma: no cover - depends on local Docker availability
300 runtime.postgres_skip_reason = f"Postgres unreachable at {external_dsn!r}, and automatic provisioning failed: {raised_exc}"
301
302
303def configure_redis(runtime: HordeTestRuntime) -> None:

Callers 1

build_test_runtimeFunction · 0.85

Calls 3

resolve_postgres_dsnFunction · 0.85
postgres_reachableFunction · 0.85
start_managed_postgresFunction · 0.85

Tested by

no test coverage detected