with one click
run-tests
"
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
"
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
"
"
"
"
"
"
| name | run-tests |
| description | " |
Makefile — all test targets and their Docker invocationstests/helpers/test_helper.bash — _common_setup, make_claude_envelopetests/helpers/mock_claude.bash — setup_mock_claude, dispatch modeDockerfile.test — the test image (must be built if changed)| Command | What it tests | Speed |
|---|---|---|
make test-unit | Individual lib/*.sh functions | ~30s |
make test-scripts | scripts/validate-skill.sh, scripts/validate-subagent.sh | ~15s |
make test-edge | Budget exhaustion, corrupt state, special chars, numeric edge cases | ~20s |
make test-integration | Phase-level pipeline (gather, synthesize, resume) | ~60s |
make test-all | All of the above | ~2min |
make test-all
make test-unit # fastest, run after every lib change
make test-scripts # after changes to scripts/validate-*.sh
make test-edge # after changes to budget, config, or CLI arg handling
make test-integration # after changes to gather.sh, synthesize.sh, or merge.sh
The Makefile targets use Docker. To run one file, use the docker command directly:
docker run --rm \
-v "$(pwd)":/workspace \
-w /workspace \
ghcr.io/joelbarmettleruzh/ultrainit-test:latest \
bats tests/unit/agent_run.bats
Add --tap for TAP format or --verbose-run for assertion details:
docker run --rm -v "$(pwd)":/workspace -w /workspace \
ghcr.io/joelbarmettleruzh/ultrainit-test:latest \
bats --verbose-run tests/unit/agent_run.bats
ok N - test name = passnot ok N - test name = fail, followed by assertion details# (from function ... source ... line N) = exact location of failed assertionIntegration tests always show green in CI even when failing — they run with || true in .github/workflows/test.yml. After make test-integration, read the output explicitly.
Add echo "TMPDIR: $TEST_TMPDIR" >&3 inside the failing @test body (bats redirects >&3 to the terminal). Run the test in verbose mode.
cat $TEST_TMPDIR/.ultrainit/mock_claude.log # all mock invocations
Look for CALL: lines. If the mock was never called when it should have been, check if setup_mock_claude was called in setup().
Dispatch mode matches agent name from the --json-schema argument basename (case-insensitive substring). If docs matches before docs-scanner, rename the dispatch file: longer/more-specific names first alphabetically.
Passing raw fixture JSON where an envelope is expected causes run_agent to extract .structured_output as null, writing "null" to the findings file silently:
# Wrong — raw JSON, no envelope
cat tests/fixtures/findings/identity.json > "$MOCK_CLAUDE_RESPONSE"
# Correct — envelope-wrapped
make_claude_envelope "$(cat tests/fixtures/findings/identity.json)" "0.15" > "$MOCK_CLAUDE_RESPONSE"
Only needed when Dockerfile.test changes:
make test-image # builds locally
The CI image is pulled from ghcr.io/joelbarmettleruzh/ultrainit-test:latest. If the image doesn't exist yet on a fresh fork, run make test-image first.