Skip to content

regression-env: refuse compose-era test DB URLs (localhost:543x / *_test_db) instead of reachability timeout #696

Open

Description

@elliotBraem

Problem

ADR 0038 retired docker-compose: all test databases are in-memory pglite, and CI no longer runs postgres. But a compose-era URL can still sneak into .env.test (or .env) and the current dev-data guard does not catch it.

What happened in practice (PR #403): a new plugin's .env.test entry carried a stale compose-era test URL —

AGENT_CONNECT_DATABASE_URL=postgres://everythingdev:everythingdev@localhost:5434/api_test_db

The regression suite resolved it, waitForDatabases (tests/regression/lib/start-stack.mjs) probed localhost:5434, found nothing listening (line removed from CI), and every regression job failed after its full retry budget with:

Error: test databases not reachable: localhost:5434 ...

Why the guard missed it

legacyDevDatabaseUrl in tests/regression/lib/regression-env.mjs refuses only the dev-data shapes:

  • pglite dev default (pglite:.bos/db)
  • postgres on localhost with user/pass everythingdev:everythingdev and db name exactly api_db or auth_db

api_test_db on port 5434 passes that check, so instead of a fail-fast refusal the run dies on a slow reachability timeout with no pointer at the actual mistake.

Proposal

Teach the guard to also classify compose-era test DB URLs and refuse them (with the same override escape hatch, REGRESSION_ALLOW_DEV_DB=1):

  • localhost postgres URLs pointing at the compose-era test ports/hosts (5432–5435 range on localhost/127.0.0.1)
  • db names matching the compose-test convention (api_test_db, auth_test_db, and any *_test_db)

The refusal message should point at the fix: regenerate .env.test via pnpm run bos dev, or set the secret to pglite::memory: per ADR 0038.

Reference

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions