Repository navigation
Make CLI tests independent of the published image - #152
Merged
Merged
Conversation
The ssh host key test ran `tug node add` with the package's default image, which the CLI looks up in the registry. On the commit that cuts a release the image is not built yet, so the lookup failed and CI went red on every version-packages commit. The runtime now carries an optional `inspectImage`, and the test runtime answers "published" by default, so no in-process test reaches the registry. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
An ESLint rule keeps child processes, and so ssh, inside process.ts and host.ts, where the host key remedy is applied. The end-to-end test shrinks from eleven commands to the ones that catch an ssh failure. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why main went red
CI failed on the `chore: version packages (#141)` commit in all three Check jobs. `every command that runs ssh prints the ssh-keygen -R remedy` ran `tug node add` with the package's default image (`ghcr.io/wpelevator/tug:3.1.0`). The CLI looks that image up in the registry first, and on the commit that cuts a release it is not built yet. The command stopped with "is not published yet" before it reached ssh, so the assertion never saw the remedy. Every release commit would have failed the same way.
Fix
No changeset: test-only, no change to the CLI, wire protocol or persisted formats.
Verification
Typecheck, lint and prettier pass locally, as do `ssh-hostkey.test.ts` and `host.test.ts`. The full `npm test` was still running when I opened this; CI is the check for the rest.
🤖 Generated with Claude Code
Follow-up in this PR: a cheaper guard for the ssh claim
The failing test claimed every command that runs ssh prints the host key remedy. Unit tests already cover the hint, the wrappers and the probes, so the end-to-end run only had to show that every ssh goes through those wrappers. An ESLint rule now enforces that (child processes only in
process.ts,commands/host.tsandconfig.ts), tested inruntime-boundary.test.ts. The end-to-end test runs 4 commands instead of 11: the ones that catch an ssh failure, plusnode add.