test(cli): point PATH at the fixture so uninstall isolation holds on any machine - #2041
Open
CaptainMittens wants to merge 2 commits into
Open
test(cli): point PATH at the fixture so uninstall isolation holds on any machine#2041CaptainMittens wants to merge 2 commits into
CaptainMittens wants to merge 2 commits into
Conversation
…any machine cli_uninstall_quiesces_active_cohort_before_removing_binary_and_index moved HOME and CBM_CACHE_DIR into a temporary directory but left PATH alone. Agent detection reads PATH first, so a real agent binary on the developer's machine was found even though HOME pointed at the empty fixture. Uninstall then tried to edit that agent's config file inside the fixture, failed because the fixture never created one, and stopped before removing the binary and the index. The test measures exactly that removal, so it failed. On this machine the agent is Goose, at /Users/<me>/go/bin/goose. Same tree and same built runner, only PATH differs: goose on PATH 291 passed, 1 failed goose off PATH 292 passed, 0 failed With this change the suite reports 292 passed, 0 failed while goose is still on PATH, so the fix is the redirect and not a quieter environment. This only stops the suite from depending on what the developer has installed. The abort it exposed is a real defect and is reported in DeusData#1954: one agent config that cannot be edited stops teardown for every other agent and for the executable and indexes. Eleven other tests that call cli_activation_save_env leave PATH open the same way. They pass today, so I left them alone rather than change what they exercise without evidence. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Joshua Richter <jrichter5781@gmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
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.
What this changes
One test moved
HOMEandCBM_CACHE_DIRinto a temporary directory but leftPATHalone.This points
PATHat the same fixture and restores it afterwards, using thesave_test_env/restore_test_envpair that the Copilot and VS Code tests in this filealready use. Ten added lines, one test, no production code.
Why the test failed
Agent detection reads
PATHbefore anything else, so a real agent binary on thedeveloper's machine is found even though
HOMEpoints at an empty fixture.uninstallthen tries to edit that agent's config file inside the fixture, fails because the fixture
never created one, and stops before removing the binary and the index — which is the thing
cli_uninstall_quiesces_active_cohort_before_removing_binary_and_indexmeasures.On my machine the agent is Goose, at
/Users/<me>/go/bin/goose:The test then fails on
ASSERT_EQ(rc, 0)withrc == 1.Evidence
Same tree, same built
test-runner, onlyPATHdiffers:gooseonPATH, before this change291 passed, 1 failedgooseremoved fromPATH, before this change292 passed, 0 failedgooseonPATH, after this change292 passed, 0 failedThe third row is the one that matters: the suite is green while
gooseis still installedand still on
PATH, so the fix is the redirect rather than a quieter environment.This does not fix the underlying defect
The abort it exposed is real, and I reported it on #1954, which already tracks the same
abort reached through a symlinked Cursor config. One agent config that cannot be edited
stops teardown for every other agent and for the executable and indexes. That wants a
product decision I did not want to make for you — treat "nothing to remove" as success at
the two call sites, or keep it an error that no longer gates the executable and index
removal — so this PR only stops the test suite from depending on what the developer has
installed.
Scope I deliberately left alone
Fourteen tests call
cli_activation_save_env. Twelve leavePATHopen the same way; onlycli_install_config_failure_keeps_published_binaryandcli_update_already_current_does_not_quiesce_sessionsredirect it today.I changed only the one that demonstrably fails. The other eleven pass on this machine, and
redirecting
PATHin a passing test changes what it exercises, so I did not want to do thatwithout a failure to point at. Happy to send that as a follow-up if you would rather have
the whole class covered at once.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ERsNp8UNLaixL4uUz7hRTX