Skip to content

Add dogfood-viewer.mjs: use the product to visually regression-test itself - #89

Merged
stolau merged 1 commit into
mainfrom
dogfood-viewer-script
Jul 27, 2026
Merged

Add dogfood-viewer.mjs: use the product to visually regression-test itself#89
stolau merged 1 commit into
mainfrom
dogfood-viewer-script

Conversation

@stolau

@stolau stolau commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

Answers "how could we take our own product into use in e2e" -- picked the persistent-instance
option (over a throwaway smoke test, or committing baseline PNGs into this repo), since you're
separately standing up a real hosted instance to point this at. Review happens through the real
viewer itself, closing the loop completely.

Fundamentally different lifecycle from e2e.test.ts's fully ephemeral backend: this script
targets a real, long-lived instance via PPS_SERVER_URL / PPS_VIEWER_URL (PPS_API_TOKEN
optional -- the same env var convention packages/client already establishes), and never
auto-approves
. It captures a handful of the viewer's own key pages -- run list, run detail,
snapshot detail dual/single, Settings, Branches & Releases -- with the real client library,
uploaded under fixed names so repeated runs diff against whatever was previously approved. Each
run also seeds a small amount of fresh demo data (a passing baseline + a genuine regression) so
there's always something real to look at, even on a brand-new instance.

The point: a layout regression in the viewer itself -- the kind this project has so far only
caught by hand via one-off Docker/Podman screenshots -- becomes a real, reviewable diff instead.

PPS_SERVER_URL=https://your-backend PPS_VIEWER_URL=https://your-viewer \
  [PPS_API_TOKEN=...] npm run dogfood -w examples/demo-app

Test plan

  • Built and ran the real backend + viewer as two separate origins under Podman (mirroring the
    separate-host deployment this repo already supports)
  • Ran the script against them end to end -- seeded data, captured all 6 pages, uploaded,
    processed, all landed as approved-baseline-missing (no auto-approve)
  • Confirmed via the live viewer that the captured dogfood-run-list snapshot genuinely shows
    the viewer's own run list rendered inside itself -- the full recursive loop, not just
    individual pieces in isolation
  • Verification stack torn down completely afterward
  • npm run lint --workspaces clean
  • npm test --workspaces + npm run test:e2e -w examples/demo-app (14/14) + backend
    pytest (142/142) -- all unaffected, confirming this addition didn't disturb anything
  • examples/demo-app/CODEMAP.md updated

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01NrQeh9CXrigN1cvpJuyzy4

…tself

Prompted by "how could we take our own product into use in e2e" --
picked the persistent-instance option over the two cheaper ones (a
throwaway smoke test, or committing baseline PNGs to this repo), since
the author is separately standing up a real hosted instance to point
this at, closing the loop completely: review happens through the real
viewer, the same as any other snapshot.

Fundamentally different lifecycle from e2e.test.ts's fully ephemeral,
self-contained backend (spawned and torn down within one vitest run):
this script targets a real, long-lived instance via PPS_SERVER_URL /
PPS_VIEWER_URL (PPS_API_TOKEN optional) -- the same env var convention
packages/client already establishes -- and never auto-approves. A
handful of the viewer's own key pages (run list, run detail, snapshot
detail dual/single, Settings, Branches & Releases) get captured with
the real client library and uploaded as ordinary snapshots, under
fixed names so repeated runs diff against whatever was previously
approved -- there's nothing dogfood-specific about the diffing itself,
it's the same mechanism as any other use of the product. Each run also
seeds a small amount of fresh demo data (a passing baseline plus a
genuine regression against it) so there's always something real for
the captured pages to render, even against a brand-new instance.

The point: a genuine layout regression in the viewer itself -- the
kind this project has so far only ever caught by hand, via one-off
Docker/Podman screenshots (an image silently shrinking to its
intrinsic size, a popup drifting off its anchor) -- becomes a real,
reviewable diff instead, surfaced the same way any other product's
visual regression would be.

Verified for real: built and ran the actual backend+viewer as two
separate origins under Podman (mirroring the separate-host deployment
this repo already supports), ran the script against them end to end,
and confirmed via the live viewer that the captured "dogfood-run-list"
snapshot genuinely shows the viewer's own run list rendered inside
itself -- the full recursive loop working, not just individual pieces
in isolation. Verification stack torn down completely afterward.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NrQeh9CXrigN1cvpJuyzy4
@stolau
stolau merged commit 346b597 into main Jul 27, 2026
5 checks passed
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