1 Commits

Author SHA1 Message Date
Zachary Lowden d3ec4748dd test(preview): buzz / membership / download e2e specs (#2467)
* test(preview): buzz / membership / download e2e specs

Extends the preview smoke harness with the first tranche of flow coverage
(revenue/access surfaces), run report-only against deployed previews as the
minted fixture users:

- preview-buzz.spec.ts: /purchase/buzz + /pricing render package/plan options
  and a checkout affordance for a gate-passing paid member (gold); no transact.
- preview-membership.spec.ts: gold (paid) sees the current-member view;
  tester (free) is SSR-redirected to /pricing and sees a subscribe CTA. Keys on
  the deterministic getServerSideProps redirect, not copy.
- preview-download.spec.ts: gold + tester reach a model detail page from the
  listing (no hardcoded id) and see a download affordance. (restricted is NOT
  used — it fails the gate; the in-app comparison is free vs paid, and the code
  has no guaranteed free/paid download difference outside early-access.)

Also anchor the preview-config testMatch to the filename
(/(^|\/)preview-.*\.spec\.ts$/) — the unanchored form matched a parent dir
named like a worktree (civitai-preview-*) and wrongly pulled the non-preview
specs (auction/generation/example) into the preview run.

Selectors are first-draft (broad/resilient) and get validated by the next
report-only preview run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(preview): make download spec light + robust (was crashing the preview)

The first draft browsed the heavy /models infinite-scroll listing and clicked
the first card, for both gold AND tester across 4 workers. That load crashed the
single-replica preview pod (exit 139) and cascaded fast failures into the rest
of the suite (base smoke went red as collateral on PR #2467 run jpcgz).

Rework: resolve a real model id from the public /api/v1/models API and navigate
directly to /models/<id> — no listing, no fragile card selector — and assert as
gold only (no free-vs-paid download difference exists outside early-access).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(preview): run smoke suite serially (workers:1)

The expanded 19-test suite at workers:4 segfaulted the single-replica preview
pod (exit 139) under concurrent heavy-page loads, cascading fast failures into
unrelated tests (base smoke loads went red on PR #2467 run s97wq even after the
download spec was lightened). The pod can't take concurrent load; run one page
at a time. Suite is small + report-only, so serial (~2-3 min) is the right call.
Reverses the earlier workers:4 — that suited a 12-test light suite, not this.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: rebuild preview to validate heap fix (2Gi/1536)

* test(preview): authed warm-up of heavy pages + 60s nav timeout

Mop up the last cold-load flake (`tester loads /models`) now that the pod OOM
is fixed. Two changes:
- Warm /models + /images (not just /) in setup, AUTHENTICATED with the gold
  cookie — an anon GET would just hit the gate's /login redirect and never warm
  the real listing render path.
- navigationTimeout 45s -> 60s, aligned with the per-test timeout, so a cold
  /models goto gets the full budget instead of dying at 45s.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 17:30:28 -05:00