-
Notifications
You must be signed in to change notification settings - Fork 16
integration-test-env: add start (brings up the stack only, no tests)
#2091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,24 +14,41 @@ via the `docker/docker-compose.orchestrator.yml` file. | |
|
|
||
| ## How It Works | ||
|
|
||
| The orchestrator runs a 6-phase pipeline: | ||
| The lifecycle runs a 6-phase bring-up: | ||
|
|
||
| 1. **Postgres + Devnet** — started in parallel via testcontainers | ||
| 2. **ENSRainbow database** — downloads pre-built LevelDB, extracts, starts ENSRainbow from source | ||
| 3. **ENSIndexer** — starts from source, waits for health | ||
| 4. **Indexing** — polls until omnichain status reaches "Following" or "Completed" | ||
| 5. **ENSApi** — starts from source, waits for health | ||
| 6. **Integration tests** — runs `pnpm test:integration` | ||
| 2. **Seed devnet** — primary names and resolver records | ||
| 3. **ENSRainbow database** — downloads pre-built LevelDB, extracts, starts ENSRainbow from source | ||
| 4. **ENSIndexer** — starts from source, waits for health | ||
| 5. **Indexing** — polls until omnichain status reaches "Following" or "Completed" | ||
| 6. **ENSApi** — starts from source, waits for health | ||
|
|
||
| Two entrypoints share that bring-up: | ||
|
|
||
| - `pnpm start` — bring up the stack and wait for Ctrl+C. Use this when you want to point `pnpm test:integration` (or anything else) at a long-lived stack. | ||
| - `pnpm start:ci` — bring up the stack, run `pnpm test:integration` at the monorepo root, then tear everything down (CI flow). | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Automated | ||
| ### Bring up the stack (manual) | ||
|
|
||
| ```sh | ||
| pnpm start | ||
| ``` | ||
|
|
||
| Works both in CI and locally — just make sure the required ports are available (8545, 8000, 3223, 42069, 4334). | ||
| Brings up the full stack and blocks until Ctrl+C. The required ports must be available (8545, 8000, 3223, 42069, 4334). Once it's up, run integration tests from another terminal: | ||
|
|
||
|
|
||
| ```sh | ||
| pnpm test:integration | ||
| ``` | ||
|
Comment on lines
+39
to
+43
Comment on lines
+41
to
+43
Comment on lines
35
to
+43
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win Consider documenting the The PR introduces an To bring up only specific services, use the `--only` flag:
```sh
pnpm start --only devnet,ensrainbowVerify each finding against current code. Fix only still-valid issues, skip the In |
||
|
|
||
| ### Full CI pipeline (bring up + tests + tear down) | ||
|
|
||
| ```sh | ||
| pnpm start:ci | ||
| ``` | ||
|
|
||
| Works both in CI and locally — just make sure the required ports are available. | ||
|
|
||
| ### Manual (local development) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,8 @@ | |
| "type": "module", | ||
| "description": "Integration test environment orchestration for ENSNode", | ||
| "scripts": { | ||
| "start": "CI=1 tsx src/orchestrator.ts", | ||
| "start": "tsx src/start.ts", | ||
| "start:ci": "CI=1 tsx src/ci.ts", | ||
|
Comment on lines
+9
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Search for references to process.env.CI in the integration-test-env package.
rg -nP --type=ts -g 'packages/integration-test-env/**' '\bprocess\.env\.CI\b'Repository: namehash/ensnode Length of output: 42 🏁 Script executed: # Check the structure of the integration-test-env package
find packages/integration-test-env -type f -name "*.ts" -o -name "*.js" | head -20Repository: namehash/ensnode Length of output: 561 🏁 Script executed: # Look at the ci.ts file to understand what it does
cat packages/integration-test-env/src/ci.tsRepository: namehash/ensnode Length of output: 1180 🏁 Script executed: # Check if lifecycle.ts exists and where
find packages/integration-test-env -name "lifecycle.ts" -o -name "lifecycle.js"Repository: namehash/ensnode Length of output: 107 🏁 Script executed: # Search for any CI environment variable usage in broader context (not just process.env.CI)
rg -n 'CI' packages/integration-test-env/src --type=ts -B2 -A2Repository: namehash/ensnode Length of output: 1379 🏁 Script executed: # Check the package.json dependencies to understand what lifecycle.ts might be from
cat packages/integration-test-env/package.jsonRepository: namehash/ensnode Length of output: 738 🏁 Script executed: # Examine the full lifecycle.ts to check for CI environment variable usage
cat packages/integration-test-env/src/lifecycle.tsRepository: namehash/ensnode Length of output: 12435 Remove or use the unused The 🤖 Prompt for AI Agents |
||
| "typecheck": "tsc --noEmit" | ||
| }, | ||
|
Comment on lines
8
to
12
|
||
| "dependencies": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||
| /** | ||||||
| * `pnpm -F @ensnode/integration-test-env start:ci` | ||||||
| * | ||||||
| * Integration Test Environment CI flow. | ||||||
| * | ||||||
| * Brings up the full stack, runs monorepo-level integration tests, then tears everything down. | ||||||
| * For the manual flow that brings up the stack and waits for Ctrl+C without running tests, use | ||||||
| * `pnpm start` (start.ts). | ||||||
| * | ||||||
| * Phases (lifecycle.bringUp + test run): | ||||||
| * 1. ENSDb (postgres) + devnet via docker-compose (testcontainers DockerComposeEnvironment) | ||||||
| * 2. Seed devnet (primary names and resolver records) | ||||||
| * 3. Start ENSRainbow via `pnpm entrypoint` (downloads + extracts the prebuilt LevelDB in the background) | ||||||
| * 4. Start ENSIndexer | ||||||
| * 5. Wait for omnichain-following / omnichain-completed (indexing complete) | ||||||
| * 6. Start ENSApi | ||||||
| * 7. Run `pnpm test:integration` at the monorepo root | ||||||
| */ | ||||||
|
|
||||||
| import { bringUp, cleanup, runIntegrationTests } from "./lifecycle"; | ||||||
|
|
||||||
| async function main() { | ||||||
| await bringUp(); | ||||||
| runIntegrationTests(); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing
🐛 Proposed fix await bringUp();
- runIntegrationTests();
+ await runIntegrationTests();
await cleanup();📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| await cleanup(); | ||||||
| process.exit(0); | ||||||
| } | ||||||
|
|
||||||
| main().catch(async (e: unknown) => { | ||||||
| console.error(`[ci] ERROR: ${String(e)}`); | ||||||
| await cleanup(); | ||||||
| process.exit(1); | ||||||
| }); | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
README lists incorrect ports (includes non-existent 8000, omits PostgreSQL port 5433)