(runtime: HordeTestRuntime)
| 283 | |
| 284 | |
| 285 | def 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 | |
| 303 | def configure_redis(runtime: HordeTestRuntime) -> None: |
no test coverage detected