Skip to content

fix(playwright): default DB DSN to the dev host for local runs#121

Merged
AquiGorka merged 1 commit into
mainfrom
fix/playwright-local-db-dsn
Jun 17, 2026
Merged

fix(playwright): default DB DSN to the dev host for local runs#121
AquiGorka merged 1 commit into
mainfrom
fix/playwright-local-db-dsn

Conversation

@AquiGorka

Copy link
Copy Markdown
Contributor

Problem

Running the playwright full-flow the documented way — npx playwright test against the local up.sh stack — dies at Step 6b with:

Error: getaddrinfo ENOTFOUND db

helpers/db.ts defaulted PG_BASE_URL to postgresql://admin:devpass@db:5432. db is the postgres service hostname inside the playwright Docker network; from the dev host postgres is localhost:5442, so every direct DB query (PP discovery in Step 6b, settlement check in Step 13, cleanup) failed. The README claims "local defaults work out of the box" — they didn't.

Fix

  • helpers/db.ts: default to the dev-host DSN localhost:5442 (the documented local flow).
  • docker-compose.playwright.yml: set PG_BASE_URL=postgresql://admin:devpass@db:5432 on the test-runner service so the in-network Docker suite (./test.sh playwright) is unchanged.

Net: npx playwright test works against the up.sh stack with no env; the Docker path keeps resolving db via the explicit override.

Verification

Full-flow against the local stack, no PG_BASE_URL set (so the new default is exercised): 16/16 steps pass (was failing at Step 6b on ENOTFOUND db). Run with --retries=0 — an honest first-try pass, not a retry mask.

helpers/db.ts defaulted PG_BASE_URL to the Docker hostname `db:5432`, which
only resolves inside the playwright compose network. The documented local
flow (`npx playwright test` against the up.sh stack) runs on the dev host,
where postgres is `localhost:5442` — so it died at the first DB query with
`getaddrinfo ENOTFOUND db` (full-flow Step 6b), despite the README saying
local works out of the box.

- db.ts: default to the dev-host DSN (localhost:5442).
- docker-compose.playwright.yml: set PG_BASE_URL=...@db:5432 on the
  test-runner so the in-network Docker suite is unchanged.
@AquiGorka AquiGorka merged commit 6cb80d0 into main Jun 17, 2026
10 checks passed
@AquiGorka AquiGorka deleted the fix/playwright-local-db-dsn branch June 17, 2026 17:19
AquiGorka added a commit that referenced this pull request Jun 17, 2026
…122)

Documents the "correct way to run" details that weren't written down
(and that cost real debugging time):

- **Which suites need extra sibling repos** beyond provider/council:
`pos-instant` (+pay-platform, moonlight-pay); `invite-gate`/`playwright`
(+provider-console, council-console, +vendored Freighter via
`setup-freighter.sh`).
- **The full playwright UI flow runs on the dev host** — `./up.sh` +
`npx playwright test` (→ playwright/README), **not** the Docker
`./test.sh` path. Notes the DB DSN default (`localhost:5442`, with the
Docker runner overriding to `db:5432` — per #121).
- **Testnet**: `run-all.sh` = deployed testnet (needs Tempo/OTEL creds);
`run-local.sh` = local `up.sh` stack.

No flakiness claims — every line is verified against the compose files /
scripts / a real run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant