Conversation
Port the reference go-app-starter e2e test packaging pattern to this repo so `nix build .#e2e-tests` builds the dev backend, installs JavaScript dependencies from a fixed-output pnpm store, and runs Playwright with Nix-provided browsers and fonts. Use pnpm 10.25.0 instead of pnpm 11.5.3 so the flake can use the same `pnpm.fetchDeps` and `pnpm.configHook` flow as go-app-starter. This avoids custom pnpm store extraction logic and keeps the Nix target close to the reference implementation. CircleCI and package.json now pin the same pnpm version. Add `metadata_prod.go` and `metadata_dev.go` to keep the e2e target hermetic. Production builds still construct the real TMDB metadata finder and require `SJ_TMDB_API`. Dev builds continue to use the real TMDB client by default, but if `SJ_TMDB_API=dummy`, they use deterministic in-process fake metadata for the titles that the Playwright suite searches for. The Nix e2e target sets that dummy value so it does not require a secret TMDB key or network access during `nix build`.
Co-authored-by: Shelley <shelley@exe.dev>
Replace the metadata_dev.go/metadata_prod.go build-tag split (which injected an in-process fake MetadataFinder when SJ_TMDB_API=dummy) with a mock TMDB HTTP server run by the Playwright e2e harness. TMDB is called server-side, so Playwright's page.route() can't intercept it directly. Instead, make the TMDB client's base URL configurable via SJ_TMDB_API_BASE_URL (defaulting to the production API) and have the e2e fixtures start an in-process mock TMDB server, pointing the spawned backend at it. Poster requests to image.tmdb.org are stubbed via page.route so no browser request escapes to the Internet. This keeps `nix build .#e2e-tests` hermetic without baking fake data into the production binary. Verified: go build (prod + dev), go test, gofmt, go vet, and a hermetic `nix build .#e2e-tests` (46/46 Playwright tests pass, no network). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts: # metadata/tmdb/tmdb.go
# Conflicts: # flake.lock # flake.nix
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Switch e2e tests to use a mock TMDB server instead of hitting the real thing.