feat: test containers#412
Draft
matheus1lva wants to merge 2 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Adds
TestEnvironment— a Testcontainers-based E2E harness that spins up the full kong stack (ingest + web + Postgres + Redis) as isolated Docker containers per test run. Tests can inject custom chain/ABI/manual config as plain JS objects, trigger indexing via BullMQ, poll for DB results, run refresh scripts against the live containers, and assert on the web API — all without any external infra.Also adds a GitHub Actions
testworkflow that runslibandingestunit tests on every PR.How to review
packages/lib/helpers/containers.ts— core:TestEnvironment,ConfigOverrides,createTestPool,pollForRow,triggerFanout,runScriptpackages/ingest/containers.spec.ts— example E2E test (ingest vault → web snapshot)docker/ingest.Dockerfile+docker/web.Dockerfile— service images built at test timedocs/testing.md— usage referenceUnit test changes (
tests.ts,hook.spec.ts) fix PG11→PG16 compatibility: health-check wait strategy + correctblock_timefor the 7-day filter.Test plan
node_modules/.bin/ts-node packages/ingest/run-e2e.ts— requires.envwithHTTP_ARCHIVE_1,HTTP_FULLNODE_1,YDAEMON_API. Expect1 passingin ~2–4 min after containers start.bun --filter lib testandbun --filter ingest testrun in CI via.github/workflows/test.ymlon every PR.Risk / impact
tests.tsimage bump (timescaledb:2.1.0-pg11→latest-pg16) affects all ingest/lib unit tests; migrations validated against PG16