Repository navigation
Integration test harness - #223
codefather2026 wants to merge 2 commits into
Conversation
Miracle656
left a comment
There was a problem hiding this comment.
Good news first: this doesn't rebuild the harness. The headline number (+1262) is misleading — 1178 of those additions are package-lock.json, so the human diff is about 84 lines across 9 files, and several of them are real fixes I want. The problem is the base: the branch is cut from 86c971e ("Merge #125"), which is a long way behind, and #178 has since landed a dual-network harness in the same directory. That makes one change in here actively destructive.
The blocker: vitest.integration.config.ts stops running six of the seven integration suites
- include: ["tests/integration/**/*.test.ts"],
+ // Older files in this directory belong to standalone Jest/DB suites. This
+ // command is the compose-backed black-box API suite for issue #63.
+ include: ["tests/integration/api.test.ts"],The comment isn't accurate. tests/integration/dual-network.test.ts (420 lines — it is #178, the dual-network isolation harness), reorg.test.ts (226 lines) and reorg-rollover.test.ts (93 lines) all import { describe, expect, it } from "vitest" and are run today by that glob. Narrowing include to a single file means npm run test:integration and the CI "Integration tests" job report green off 5 tests while 739 lines of reorg and dual-network coverage silently stop executing. That's the one change I can't take.
If the goal was to keep e2e.test.ts, migrations.test.ts and ws.test.ts out (those three do use bare globals against globals: false), exclude those three by name rather than allow-listing one file — and note main's jest config already has testPathIgnorePatterns for tests/integration/ and tests/chaos/, so those three currently run under neither runner. Worth a follow-up issue rather than solving it here.
Already on main, please drop on rebase
package.json— thetestPathIgnorePatternsblock you add is byte-for-byte whatmainalready has.- The PR description lists "Add a Postgres and Wraith test stack", "Add
npm run test:integration" and "Add a pull-request CI job". All three are onmainalready (docker-compose.test.yml, thetest:integrationscript, theintegrationjob inci.yml), anddocker-compose.test.ymlalready setsSKIP_INDEXER: "true". tests/integration/fixtures.ts— this file no longer exists; fixtures were consolidated intosrc/fixtures.ts. Your +22 to it and thesetup.tsimport ofseedAccountSummariesfrom"./fixtures"are the merge conflict.tests/integration/api.test.ts—mainalready reworked this assertion, but in the other direction: it now calls/summary/:addresswith a comment noting that/accounts/:address/summaryis shadowed by the accounts router and returns the{ address, assets }shape. Yourassets/net/lastActivityAtexpectation is correct for/accounts/:address/summary, so if you want to keep testing that endpoint, add it as a second test instead of converting the existing one — covering both shapes is strictly better than either.
One thing to pull out of the lockfile
package.json moves vitest from ^3.2.4 to ^4.1.9. That's a major bump of the integration runner and it's where essentially all 1178 lockfile lines come from. At your base there was no vitest devDependency at all, so adding one was right then; against current main it's an unrelated major upgrade riding along in a test-harness PR. Please drop it back to ^3.2.4 — if vitest 4 is worth doing, it deserves its own PR where a red run is attributable.
Keep these — they're the good part of the PR
src/index.ts: theSKIP_INDEXERguard.docker-compose.test.ymlhas been setting that variable while the code ignored it, so the test container has been booting the indexer against a live RPC endpoint this whole time. Genuine fix.Dockerfile:apk add --no-cache opensslin both stages andnpm run db:generatein the runner. Correct — Prisma's engine needs OpenSSL on alpine, and the runner'snpm cidoes land a freshnode_moduleswith no generated client..dockerignore, the CItimeout-minutes: 20, anddocker compose logson failure.setup.ts:AbortSignal.timeout(5_000)on the healthz poll — without it a hung connect eats the whole boot budget in one attempt.
What I could and couldn't run: the Docker daemon isn't running on this machine, so I could not execute npm run test:integration against the compose stack — I'm reviewing these by reading, not by observing a pass. Worth knowing that CI didn't cover for me either: the only check on this PR is GitGuardian. The typecheck, integration and chaos jobs haven't run on your branch (compare #210, which has all four). They should run on your next push now that fork workflow approval is cleared — please make sure they're green before re-requesting.
Rebase onto main, restore the include glob, drop the three already-landed pieces and the vitest 4 bump, and the remainder is a clean merge.
Closes #63
Summary
Adds a Docker Compose integration-test harness that runs Wraith against a real PostgreSQL database and exercises the running HTTP API with deterministic fixtures.
Changes
SKIP_INDEXER/accounts/:address/summarynpm run test:integration.dockerignoreto reduce Docker build contextTesting
npm run builddocker compose -f docker-compose.test.yml config --quietdocker compose -f docker-compose.test.yml up -d --buildnpm run test:integration— 5 tests passeddocker compose -f docker-compose.test.yml down -v