Skip to content

feat: test containers#412

Draft
matheus1lva wants to merge 2 commits into
mainfrom
feat/test-containers
Draft

feat: test containers#412
matheus1lva wants to merge 2 commits into
mainfrom
feat/test-containers

Conversation

@matheus1lva
Copy link
Copy Markdown
Collaborator

@matheus1lva matheus1lva commented May 24, 2026

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 test workflow that runs lib and ingest unit tests on every PR.

How to review

  • packages/lib/helpers/containers.ts — core: TestEnvironment, ConfigOverrides, createTestPool, pollForRow, triggerFanout, runScript
  • packages/ingest/containers.spec.ts — example E2E test (ingest vault → web snapshot)
  • docker/ingest.Dockerfile + docker/web.Dockerfile — service images built at test time
  • docs/testing.md — usage reference

Unit test changes (tests.ts, hook.spec.ts) fix PG11→PG16 compatibility: health-check wait strategy + correct block_time for the 7-day filter.

Test plan

  • Manual: node_modules/.bin/ts-node packages/ingest/run-e2e.ts — requires .env with HTTP_ARCHIVE_1, HTTP_FULLNODE_1, YDAEMON_API. Expect 1 passing in ~2–4 min after containers start.
  • Automated: bun --filter lib test and bun --filter ingest test run in CI via .github/workflows/test.yml on every PR.

Risk / impact

  • No production code changed — all new files are test/build infra
  • Dockerfiles only used at test time, not in any deploy pipeline
  • tests.ts image bump (timescaledb:2.1.0-pg11latest-pg16) affects all ingest/lib unit tests; migrations validated against PG16

@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
kong Ready Ready Preview, Comment May 24, 2026 4:20pm

Request Review

@matheus1lva matheus1lva changed the title feat: add test containers feat: test containers May 24, 2026
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