Skip to content

test(tools): make test:live actually test something - #19

Merged
KageBinary merged 2 commits into
mainfrom
fix/18-live-test-gate
Sep 1, 2026
Merged

test(tools): make test:live actually test something#19
KageBinary merged 2 commits into
mainfrom
fix/18-live-test-gate

Conversation

@KageBinary

Copy link
Copy Markdown
Collaborator

Closes #18.

Problem

IX_LIVE_TESTS appeared in exactly three places — the test:live script, a CI comment, and a docstring — and no test ever read it. There was no gate for the variable to open:

$ bun test                  → 91 pass, 233 expect() calls
$ IX_LIVE_TESTS=1 bun test  → 91 pass, 233 expect() calls   ← identical

So no tool had ever run against a real ix. Every test drives the tools at /tmp/ix-test-nonexistent-workspace-99999, which only proves the fallback path — that a tool returns a string instead of throwing. A regression in argument shape, output parsing, or exit-code handling would pass the entire suite.

Change

A LiveIxCli block behind describe.skipIf(!IX_LIVE_TESTS), covering ix-stats, ix-health, and a deliberate ix-locate miss (a miss is a real answer — conflating it with an unavailable CLI is exactly the kind of bug only a live run catches).

The load-bearing assertion is the absence of each tool's unavailable marker, since that is what separates a real success from the fallback already covered offline.

The part worth reviewing

ix-health uses a different marker — Status: UNAVAILABLE, not the ix unavailable string every other tool emits. My first version asserted the wrong one, and that test passed with no ix on PATH at all.

So I checked each test both ways:

gate open, ix present gate open, ix absent
all 3 live tests pass fail

None of them is vacuous. Offline (bun test) is 91 pass / 3 skip / 0 fail, unchanged.

Verified against ix 0.10.5 and backend 1.0.27; live suite stable over three consecutive runs (~1.2s).

One caveat: the first live run in a fresh checkout took ~5 min, presumably ix registering and indexing the workspace on first use; subsequent runs are ~1.2s. Worth knowing before wiring the live suite into any automation.

Also corrects the CI comment and the test docstring, which both described an @live suite that did not exist.

`IX_LIVE_TESTS` appeared in exactly three places -- the `test:live` script, a
CI comment and a docstring -- and no test ever read it. There was no gate for
the variable to open, so `bun run test:live` ran the identical 91 offline
tests, and no tool had ever been exercised against a real `ix`.

That left every tool covered only on its fallback path: the suite drives them
at a directory where `ix` cannot succeed and asserts they return a string
rather than throwing. A regression in argument shape, output parsing or
exit-code handling would pass the whole suite.

Add a `LiveIxCli` block behind `describe.skipIf(!IX_LIVE_TESTS)` covering
ix-stats, ix-health and a deliberate ix-locate miss. The load-bearing
assertion is the absence of each tool's unavailable marker, which is what
separates a real success from the fallback the offline tests already cover.

Note ix-health uses its own marker (`Status: UNAVAILABLE`, not the
`ix unavailable` string the others use). Asserting the wrong one made that test
pass with no `ix` on PATH at all -- verified each test fails when `ix` is
absent, so none of them is vacuous.

Also corrects the CI comment and docstring, which described an @LiVe suite that
did not exist.

Closes #18
#20 landed first and appended its own `NonZeroExitDiagnostics` block to the
end of `tests/tools.test.ts`; this branch appends `LiveIxCli` to the same
place. Git saw one conflict region covering both additions.

They are independent -- `LiveIxCli` is opt-in behind `IX_LIVE_TESTS` and drives
the tools against a real `ix`, while `NonZeroExitDiagnostics` runs a stubbed
`ix` in a child process -- so both are kept, and both sets of imports survived
the merge.

bun test: 119 pass, 3 skip, 0 fail.
@KageBinary
KageBinary merged commit 9a49a30 into main Sep 1, 2026
7 checks passed
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.

test:live is a no-op — IX_LIVE_TESTS is never read, so no tool is tested against a real ix

1 participant