test(backends): add unit coverage for nativeToolRuntime shims#1052
Merged
test(backends): add unit coverage for nativeToolRuntime shims#1052
Conversation
nhopeatall
approved these changes
Mar 25, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM — well-structured unit tests that directly exercise both exported functions from nativeToolRuntime.ts. Tests cover the key behaviors (filesystem creation, shim content, permissions, cleanup idempotency, PATH ordering, and filtering) without over-mocking. All CI checks pass.
Nitpick
- tests/unit/backends/nativeToolRuntime.test.ts:2 —
beforeEachis imported fromvitestbut never used in the file. OnlyafterEachis used.
🕵️ claude-code · claude-opus-4-6 · run details
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.
Summary
tests/unit/backends/nativeToolRuntime.test.tswith 15 unit tests coveringcreateNativeToolRuntimeArtifactsandbuildNativeToolPathghshim file existence, executable permissions, and best-effort cleanupTest plan
createNativeToolRuntimeArtifacts— shim dir created on diskcreateNativeToolRuntimeArtifacts—ghshim file existscreateNativeToolRuntimeArtifacts—ghshim contains correct shell script contentcreateNativeToolRuntimeArtifacts—ghshim has executable permissions (0o755)createNativeToolRuntimeArtifacts— cleanup removes shim directorycreateNativeToolRuntimeArtifacts— double-cleanup does not throw (best-effort)createNativeToolRuntimeArtifacts— two consecutive calls produce unique directoriesbuildNativeToolPath— shim dir placed firstbuildNativeToolPath— cliToolsDir placed before basePathbuildNativeToolPath— basePath preserved at endbuildNativeToolPath— shimDir omitted when not providedbuildNativeToolPath— works with only cliToolsDirbuildNativeToolPath— filters empty string entriesbuildNativeToolPath— filters undefined basePathbuildNativeToolPath— correct full ordering with all three entriesTrello card: https://trello.com/c/Y4JTi0vG/564-as-a-developer-i-want-unit-coverage-for-native-tool-runtime-shims-so-that-cascade-native-tool-execution-stays-predictable
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details