Repository navigation
test(cli): skip the node-dependent check when node is absent - #9
Merged
Merged
Conversation
The deriveIdentity assertion shells out to `node -e` with the error swallowed by 2>/dev/null, so on a host without node it did not skip -- it failed, with a baffling `got ''`. CI never caught it because ubuntu-latest ships node. It only showed up running the suite in debian:bookworm-slim. That is precisely the "the test encodes the author's machine" trap that hid the Linux mtime bug in the hooks, reintroduced in a test written to guard against exactly that class of bug. It does not get a pass for being ours. Now guarded on node being installed, and says so when it skips. The dropped 2>/dev/null means a real node failure surfaces instead of masquerading as an empty string. macOS 145 passed. Linux without node: 144 passed, 1 correctly skipped. Co-Authored-By: Claude Opus 5 (1M context) <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.
Small, but it is the same bug we spent today removing from the hooks — reintroduced in a test written to guard against that very class.
tests/cli/test-substitutions.shexercises the CLI's identity derivation by shelling out tonode -e, with the error swallowed by2>/dev/null. On a host without node it therefore did not skip — it failed, with a baffling:CI is green on
mainand did not catch it, becauseubuntu-latestships node. It only surfaced running the suite indebian:bookworm-slimafter the merges.Now guarded on node being present, and it says so when it skips. Dropping the
2>/dev/nullmeans a genuine node failure surfaces as itself rather than masquerading as an empty string.The rest of the file is plain bash and stays useful without node — which is the right split, since the CLI is a Node program and a host without node cannot run the scaffolder anyway.
🤖 Generated with Claude Code