fix(playwright): default DB DSN to the dev host for local runs#121
Merged
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running the playwright full-flow the documented way —
npx playwright testagainst the localup.shstack — dies at Step 6b with:helpers/db.tsdefaultedPG_BASE_URLtopostgresql://admin:devpass@db:5432.dbis the postgres service hostname inside the playwright Docker network; from the dev host postgres islocalhost: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 DSNlocalhost:5442(the documented local flow).docker-compose.playwright.yml: setPG_BASE_URL=postgresql://admin:devpass@db:5432on thetest-runnerservice so the in-network Docker suite (./test.sh playwright) is unchanged.Net:
npx playwright testworks against the up.sh stack with no env; the Docker path keeps resolvingdbvia the explicit override.Verification
Full-flow against the local stack, no
PG_BASE_URLset (so the new default is exercised): 16/16 steps pass (was failing at Step 6b onENOTFOUND db). Run with--retries=0— an honest first-try pass, not a retry mask.