Repository navigation
004-05: E2E Against HoS Testnet + Docs - #40
Merged
Merged
Conversation
- api/tests/integration/e2e-stake2pay.test.ts: registers the real
stake2pay plugin through the shared harness and drives the generic
/subscriptions/* routes end to end
- mocked-RPC path (no network): local node:http server speaking the
NEAR JSON-RPC query/call_function protocol serves canned chain
fixtures and drives active -> cancel_at_period_end ->
pending_unstake -> ended, plus lock/cancel wallet intents,
NOT_FOUND and BAD_REQUEST paths
- live read-only path against hos-e2e-0601144939.testnet, gated
behind HOS_TESTNET so the ephemeral contract cannot break CI
- setup.ts: replace the shared pglite:.bos/api/:memory: path (an
on-disk directory parallel vitest forks raced on) with an isolated
throwaway pglite dir per context, removed on teardown
- docs/004-01..004-06 ticket specs mirroring GitHub issues #28-#33,
including the manual testnet wallet-signing checklist in 004-05
- README: stake2pay provider row + no-secrets variables table
- .env.example: stake2pay needs no secrets; HOS_TESTNET flag note
Closes #32
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FdKukDnRTrshKqkQ8JXwVj
5 tasks
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.
Closes #32. Part of Epic 004 (#27). Depends on #36 + #37 (merged). Last ticket of the epic alongside #38 (UI) and #39 (Stripe Billing).
What
Full-chain E2E suite (
api/tests/integration/e2e-stake2pay.test.ts) registering the real stake2pay plugin through the shared harness and driving the generic/subscriptions/*routes end to end, in two paths:node:httpserver speaks the NEAR JSON-RPCquery/call_functionprotocol and serves canned chain fixtures with mutable state. This drives the transitions the live contract can't produce on demand — the full status ladderactive → cancel_at_period_end → pending_unstake → endedthrough the real API stack — plus discovery exclusion of payment-only plugins, plan filtering (OneOff/Archived dropped), lock-intent shape (storage_depositprefix for unregistered payers,duration_ns: null), 1-yocto cancel intent, NOT_FOUND/BAD_REQUEST paths, and session-wallet payerRef defaulting.describe.skipIf(!process.env.HOS_TESTNET)): plugin defaults againsthos-e2e-0601144939.testnet— so the ephemeral testnet contract can never break CI, per the ticket.Docs:
docs/004-01…004-06mirroring issues #28–#33 (repo convention), including the manual testnet wallet-signing checklist in 004-05 (no funded key in CI). README gets the stake2pay provider row with its variables-only config table;.env.examplenotes stake2pay needs no secrets + theHOS_TESTNETflag.One deliberate fix outside the ticket's file list
setup.tspreviously pointed all E2E contexts atpglite:.bos/api/:memory:— which is not in-memory (pglite treats it as an on-disk path), so parallel vitest forks raced on one directory and the full suite flaked ~2/3 of runs before this branch. Since this ticket's AC requires the full run green,setup.tsnow gives each context an isolated throwaway pglite dir (removed on teardown), no caller changes. This is the proper fix for the footgun flagged in #37.Verified
cd api && bun run test: 49 passed, 4 skipped — three consecutive green runs (the suite was flaky before the setup.ts fix)HOS_TESTNET=1 bun run test: 53 passed, 0 skipped (live testnet)bun run typecheckgreen, biome clean on changed files🤖 Generated with Claude Code
https://claude.ai/code/session_01FdKukDnRTrshKqkQ8JXwVj