This repository was archived by the owner on Jun 8, 2026. It is now read-only.
FIX: harden Claude test isolation in desktop tests - #63
Closed
aponamarev wants to merge 1 commit into
Closed
aponamarev wants to merge 1 commit into
aponamarev wants to merge 1 commit into
Conversation
- isolate plugin-discovery tests from the developer HOME so they cannot spawn real cached wrappers - lock setupStubClaude to the fake PATH so evaluate tests cannot resolve the real Claude CLI from a login shell - tighten SSRF loop tests to use isolated allowlists and non-existent repos for deterministic early exits Testing - pnpm exec tsx --test test/symphony-loop-evaluate-code.test.ts test/symphony-loop-evaluate-plan.test.ts test/symphony-loop-ssrf.test.ts test/gateway-server.test.ts - pnpm exec tsx --test test/*.test.ts Risks - plugin-discovery tests now intentionally assert the no-plugin-cache path and rely on separate fake-plugin tests for spawn coverage Made-with: Cursor
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Desktop unit tests that stub Claude were still able to resolve the real
claudebinary becausegetShellPath()rebuiltPATHfrom the login shell. That caused long-running or flaky tests (for example EVALUATE_CODE) and downstream failures when the harness shut down while a real process was still running. This PR pins shell path resolution to the stubbedPATHand tightens a few gateway and SSRF tests so they no longer depend on the developer’s realHOMEor broad/tmpallowlists.Key Changes
Core Feature:
setupStubClaude()now callssetShellPathForTest()after settingPATH, so symphony-style tests consistently use the fakeclaudeshim instead of falling back to a real install.HOMEto an empty temp directory and assertpid === null, so a real~/.claude/plugins/cachecannot spawn wrapper scripts during CI or local runs.symphony-loop-ssrftests use per-runmkdtempallowlist roots, a synthetic repo full name that does not exist under that root, and cleanup of temp dirs—avoiding accidental matches against real checkouts under/tmpand unintended PLAN/run-loop behavior.Supporting Changes:
0.9.10; minorprebuildscript string normalization inpackage.json.Branch: fix/setupStubClaude-for-tests | Ticket: FIX | Commits: 1