ci(e2e): deploy the act-as test Safe so those specs stop skipping - #111
Open
douglance wants to merge 3 commits into
Open
ci(e2e): deploy the act-as test Safe so those specs stop skipping#111douglance wants to merge 3 commits into
douglance wants to merge 3 commits into
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Comment on lines
+14
to
+39
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: pnpm/action-setup@v5 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 22 | ||
| cache: pnpm | ||
| - run: pnpm install --frozen-lockfile | ||
|
|
||
| # Deliberately not `pnpm lint` / `pnpm test`: those run `eslint --fix .`, | ||
| # which repairs fixable violations and exits 0, so drift never surfaces on | ||
| # a gate. The pre-commit hook keeps `--fix` for local convenience. | ||
| - name: Lint | ||
| run: pnpm exec eslint . | ||
|
|
||
| - name: Typecheck | ||
| run: pnpm exec tsc --noEmit | ||
|
|
||
| - name: Unit tests | ||
| run: pnpm exec vitest run | ||
|
|
||
| # Separate job: unlike the ~15s gates above, this prerenders ~240 pages | ||
| # (proposals + contenders) and the tracked data/delegates-*.json make checkout | ||
| # heavy, so it must not delay the fast required checks. | ||
| build: |
Comment on lines
+40
to
+53
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: pnpm/action-setup@v5 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 22 | ||
| cache: pnpm | ||
| - run: pnpm install --frozen-lockfile | ||
| # env.ts requires this one; every other key is optional. | ||
| - name: Build | ||
| run: pnpm build | ||
| env: | ||
| NEXT_PUBLIC_REOWN_PROJECT_ID: test |
Comment on lines
+130
to
+134
| JSON.stringify({ | ||
| jsonrpc: "2.0", | ||
| id: null, | ||
| error: { code: -32000, message: String(error) }, | ||
| }) |
The act-as specs read getOwners() off a real Safe and skip themselves without TEST_SAFE_ADDRESS, so CI was running them as no-ops. This deploys the Safe after the chain boots and wires its address into the Playwright env. Deploying beats baking it into the image: the script is idempotent, takes seconds, and this way the image tag stays put instead of needing a version bump and a write:packages token. The step is guarded on the script existing because `indexer-ref` is a workflow input — on a ref without it, the step no-ops and those tests go back to skipping rather than failing the run. Deliberately NOT adding `reset:siwe` or a per-run PONDER_SCHEMA, both of which the plan called for. The Postgres service container is created fresh for every job, so the ponder schema and the SIWE `app` tables already start empty. Those two steps matter against a long-lived local database — a chain reboot rewinds the head under a schema that recorded a later block, and act-as leaves session rows behind between runs, which is what made the local suite non-idempotent until the tables were truncated. In CI neither can happen, so adding them would be machinery for an impossible failure. The reasoning is recorded in the workflow so the next person does not have to rediscover it. Verified: prettier clean, the step's shell body passes `bash -n`, and the locally equivalent sequence (boot, bake, export TEST_SAFE_ADDRESS, run) produced three consecutive green suites.
computeWeightInfo decides how much a member-election vote is worth and had no tests. The decay curve also existed twice — once over bigint L1 blocks here, once over float days in VoteWeightChart — with nothing forcing them to agree, so the plotted curve and the banner percentage could silently diverge. Moves the day-based curve next to its twin and adds a property test comparing them across the span. Extracts selectRelevantStageTypes out of ProposalStages' useMemo so the 7-vs-4 stage derivation is reachable as a unit. It is fed the real gov-tracker list, so an SDK change surfaces as a failing test. Adds a CI job running eslint (without --fix, unlike the test script), tsc and vitest on PRs. These gates take ~15s and were previously enforced only by a bypassable pre-commit hook.
…testnode The chain is now Nitro compiled to wasm, running in a headless browser page. browser-nitro-host.mjs serves it over HTTP on :8547 so Node clients — notably the Ponder indexer — can reach a chain that lives inside a browser; that was the blocker a Service Worker could not solve. The engine boots an empty chain, but the indexer derives delegates, proposals and elections from logs, so state alone is not enough. capture-l2-history.mjs records the testnode's history once and replay-l2-history.mjs re-executes it. Because CREATE/CREATE2 addresses derive from sender and nonce, replaying the same transactions in order reproduces every contract at its original address, so the existing governance manifest keeps working unchanged. l2-history.json is committed because regenerating it needs the very testnode this removes. network.ts points RPC at the local stack and refuses all remote egress, so a spec cannot silently fall back to public mainnet. testnode.ts resolves the act-as Safe from the testnode manifest rather than an env var, which stops two specs skipping whenever TEST_SAFE_ADDRESS was not exported. candidates.spec.ts stubs the elections list instead of branching on live state; the two cases were inverted twins, so only one could ever run. Adds governance-lifecycle.spec.ts covering the proposal lifecycle view, the first e2e coverage of the governance core.
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.
The act-as specs read
getOwners()off a real Safe and skip themselves withoutTEST_SAFE_ADDRESS, so CI was running them as no-ops. This deploys the Safe after the chain boots and wires its address into the Playwright env.Deploying beats baking it into the image: the script is idempotent (it reuses a Safe whose owners still match), takes seconds, and this way the image tag stays put instead of needing a version bump and a
write:packagestoken.The step is guarded on the script existing, because
indexer-refis a workflow input — on a ref without it, the step no-ops and those tests go back to skipping rather than failing the run.Deliberately not added:
reset:siweand a per-runPONDER_SCHEMABoth were in the plan. Neither belongs here.
The Postgres service container is created fresh for every job, so the ponder schema and the SIWE
apptables already start empty. Those two steps matter against a long-lived local database:Finalized block for chain "412346" cannot move backwards)In CI neither can happen, so adding them would be machinery for an impossible failure. The reasoning is recorded in the workflow so the next person doesn't have to rediscover it.
Verified: prettier clean, the step's shell body passes
bash -n, and the locally equivalent sequence (boot → bake → exportTEST_SAFE_ADDRESS→ run) produced three consecutive green suites.