Skip to content

test(e2e): W3 LIVE claim/conversion + deploy-lifecycle + env-switcher coverage#173

Merged
mastermanas805 merged 2 commits into
mainfrom
w3-claim-deploy-env-live-e2e
Jun 4, 2026
Merged

test(e2e): W3 LIVE claim/conversion + deploy-lifecycle + env-switcher coverage#173
mastermanas805 merged 2 commits into
mainfrom
w3-claim-deploy-env-live-e2e

Conversation

@mastermanas805

Copy link
Copy Markdown
Member

What

Next P0 UI matrix wave (W3) from the USER-FLOW-INVENTORY-AND-TEST-MATRIX: real-backend (E2E_LIVE=1-gated) cross-surface E2E for claim/conversion + deploy-lifecycle + env-switcher. Builds on the merged WS1-P1 harness (#170) and the W1/W2 specs (#171, #172) — mirrors their E2E_LIVE=1 gating, cohort tagging, cleanup-ledger + reaper patterns exactly.

Brevo-free account mint per TEST-ACCOUNTS-AND-NR-SYNTHETICS-PLAN.md: anonymous provision → /claim, which returns a real session_token usable as a dashboard Bearer. No email round-trip, no GitHub, no Brevo.

Flows covered

Claim/conversion (anon→claimed)

  • Anon cache provision → POST /claim → assert the resource is now owned by the new team and visible in GET /api/v1/resources (the dashboard's resource read surface).
  • Claim-replay: the same upgrade token claimed twice → second is 409 already_claimed (single-use JWT, rule 7).

Env switcher (dashboard)

  • Authenticated provision in development vs productionGET /api/v1/resources?env= (the exact call api/client.ts listResources(env) makes) returns only that env's resources, no cross-env leak; each provision echoes the resolved env (rule 11). (The global chrome switcher is currently retired in useDashboardCtx.ts; the load-bearing surface IS the ?env= query, which the VaultPage env tabs + any future switcher sit on.)

Deploy lifecycle — STAGING-ONLY

  • POST /deploy/new (minimal hand-rolled gzipped-tar context) → 202 accepted contract (id/app_id/status/environment) → GET /api/v1/deployments/:id/events timeline surface (fix(deployments): hide empty-state during load error (F1) #200) → DELETE → gone.
  • Tier elevation uses the dev-only POST /internal/set-tier (a freshly-claimed team is free = deployments_apps=0 → would 402). That endpoint 404s in prod, so the leg skips loudly outside a dev/staging stack — tier elevation never crosses a real billing path.
  • Deferred leg: the full Kaniko build → live-URL path (too slow/heavy for E2E). The create→accepted→events→delete contract is the user-visible integration boundary asserted here.

Each leg is a UI-action → backend-state-change → UI-read-surface assertion (the login-outage class).

Safety (rule 24)

  • E2E_LIVE=1-gated; whole file SKIPS loudly in normal PR CI (verified: 5 skipped with no live backend).
  • Cohort-branded, ledger-before-assert, inline reap + afterAll backstop + out-of-process reap-cohort.ts.
  • Named live-*.spec.ts → picked up by playwright.live.config.ts testMatch + the ledger reaper; the default mocked per-PR config ignores it.
  • Until the backend skip-cohort guards land (parallel worker PR), run against STAGING, not prod (cohort.ts:14-19).

Gate

npm run gate (tsc --noEmit && npm run build && vitest run) GREEN: 1115 passed | 3 skipped (pre-existing), mocked suite intact.

🤖 Generated with Claude Code

… coverage

Real-backend (E2E_LIVE=1-gated) cross-surface E2E for the W3 matrix wave,
building on the WS1-P1 harness + W1/W2 specs (mirrors their gating, cohort
tagging, cleanup-ledger + reaper patterns exactly). Brevo-free: accounts are
minted via anon-provision → /claim (which returns a real session_token).

Flows covered:
- Claim/conversion (anon→claimed): anon provision → /claim → the resource is
  team-owned + visible in GET /api/v1/resources; claim-replay of the same token
  → 409 already_claimed (single-use JWT, rule 7).
- Env switcher: provision dev vs prod → GET /api/v1/resources?env= returns only
  that env (the dashboard's per-env read), provision echoes the resolved env
  (rule 11).
- Deploy lifecycle [STAGING-ONLY]: /deploy/new → 202 accepted contract
  (id/app_id/status/environment) → GET /api/v1/deployments/:id/events timeline
  surface → DELETE → gone. Tier elevation uses the DEV-ONLY /internal/set-tier
  (404s + skips loudly in prod — never crosses billing). Full Kaniko
  build→live-URL leg deferred (too slow/heavy for E2E).

Each leg is a UI-action → backend-state-change → UI-read-surface assertion
(the login-outage class). Named live-*.spec.ts so per-PR CI ignores it and the
playwright.live.config.ts testMatch + the ledger reaper pick it up. Skips
cleanly (5 skipped) without E2E_LIVE.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mastermanas805
mastermanas805 enabled auto-merge (squash) June 4, 2026 20:01
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/assets/index-902QtfQT.js 161.98 KB (0%)
dist/assets/index-BsJUZYRr.css 6.13 KB (0%)

Comment thread e2e/live-claim-deploy.spec.ts Fixed
github-code-quality flagged the unused const in live-claim-deploy.spec.ts;
required_conversation_resolution on main blocked the merge. Remove the dead
constant.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
auto-merge was automatically disabled June 4, 2026 20:52

Head branch was modified

@mastermanas805
mastermanas805 merged commit 7a33cd7 into main Jun 4, 2026
18 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