You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 59e42a7
Browse filesBrowse the repository at this point in the historyBrowse files
test(desktop): panic when a unit test reaches the real ~/.buzz nest
nest_dir() fell back to ~/.buzz whenever init_nest_dir had not run,
which is always true in unit tests, so a test that reached nest code
read the real nest and could rewrite ~/.buzz/AGENTS.md.
Under cfg(test) that fallback now panics. The message says how to pin
the nest: pin_temp_nest_dir_for_thread() for work on the test thread,
or pin_nest_dir_for_test in a child-process test for work on other
threads. The new thread pin returns a guard that owns a TempDir;
dropping it unpins the thread and deletes the dir. A process-wide pin
does not fit in-process tests, because cargo test runs them all in one
process and the OnceLock can be set only once.
Seven tests reached the fallback, all through default_agent_workdir():
auth_command_uses_augmented_path_for_node_adapter,
test_prepared_install_command_uses_default_workdir and five
provider_deploy_* tests. They now pin a temp nest. Under cfg!(test)
default_agent_workdir() resolves on every call instead of caching for
the process, because a cached per-test nest would be deleted before the
next test used it.
nest_dir_is_under_home and init_nest_dir_prod_sets_buzz could only pass
by reaching the fallback. They are replaced by a should_panic test of
the guard and a test that the thread pin and its dir go away on drop.
Production behaviour is unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Matt Toohey <[email protected]>
0 commit comments