A Go harness to run unit tests in /chainlink with a simpler flow and control scheme. Plus a mode to help you hunt down flakes, races, and timeouts.
The harness resolves go test package patterns relative to its working
directory, so run it from the repository root.
From the repo root, make test builds the harness (into tools/test/.bin/test, gitignored) and forwards arguments:
make test ARGS="-h"
make test ARGS="./core/..."
make test ARGS="diagnose ./core/..."Rebuild only when you change harness code:
go -C tools/test build -o tools/test/.bin/test .
tools/test/.bin/test -count=1 ./core/...# Stop diagnose early only when a specific signal appears
make test ARGS="diagnose --iterations 20 --fail-fast-on=timeout -- --timeout=9m ./core/..."
make test ARGS="diagnose --iterations 20 --fail-fast-on=slow --slow-threshold=10s -- ./core/..."Always run from the repository root — patterns like
./core/...are resolved from the current directory, not the module. Do not usego -C tools/test run .; that forces the working directory totools/testand breaks relative patterns.
Use the fix-flaky-tests skill with your favorite agent to find, diagnose, and fix flaky, slow, and otherwise unstable tests.
There is no way to tell go test about some universal, one-time setup step (like creating a Postgres DB), so we need a light wrapper to take care of this.
We could make just go test work if we have each test package that needs a DB launch their own using testcontainers-go, but performance implications of that are still unknown.