@elench/testkit
v0.1.10
Published
CLI for running k6 tests against real, ephemeral infrastructure
Downloads
1,091
Readme
@elench/testkit
CLI that reads testkit.manifest.json from a product repo, spins up ephemeral infrastructure (Neon DB branch + Fly machine) per service, runs k6 tests, and tears down.
Prerequisites
sudo snap install k6
sudo apt-get install -y jq
curl -L https://fly.io/install.sh | sh
fly auth loginSetup
Add platform secrets to each product's .env:
NEON_API_KEY='...'
FLY_API_TOKEN='...'Product secrets (CLERK_SECRET_KEY, etc.) are also loaded from the same .env.
Usage
cd bourne
# Run all suites
npx @elench/testkit
# Specific type / suite
npx @elench/testkit int -s health
npx @elench/testkit e2e
# Specific service (multi-service products)
npx @elench/testkit avocado_api int -s health
# Build from source first
npx @elench/testkit int --build
# Lifecycle
npx @elench/testkit status
npx @elench/testkit destroyHow it works
- Config — reads
testkit.manifest.jsonfor per-service infra config + test suites - Neon — discovers or creates a
<service>-testbranch, truncates tables between runs - Fly — discovers or creates a machine on the service's test app, updates env vars
- k6 — runs matched test files with
BASE_URLandMACHINE_IDinjected - DAL — DAL tests use a bundled k6-sql binary (
vendor/k6) — no external binary needed - Cleanup — stops the Fly machine (preserved for next run)
Multi-service products run all services in parallel. Each service gets its own Neon branch and Fly machine.
State is persisted in .testkit/ (or .testkit/<service>/ for multi-service) so subsequent runs reuse existing infrastructure.
