Make transfer tests hermetic on Windows (HOME vs USERPROFILE) - #596
Closed
zebbern wants to merge 1 commit into
Closed
Make transfer tests hermetic on Windows (HOME vs USERPROFILE)#596zebbern wants to merge 1 commit into
zebbern wants to merge 1 commit into
Conversation
zebbern
commented
Aug 5, 2026
The transfer tests sandbox the home directory by setting HOME in the
child env, but Node's os.homedir() on Windows resolves via USERPROFILE,
so the spawned codex-companion computed the Claude projects dir from the
real user profile. The sandboxed transcript then failed the projects-dir
containment check before the behavior under test could run ("Codex can
import Claude sessions only from C:\Users\<real user>\.claude\..."), and
worse, the tests depended on whatever ~/.claude state the host happened
to have.
Set USERPROFILE alongside HOME in each transfer test's child env. POSIX
platforms ignore USERPROFILE, so nothing changes there.
On a Windows 11 host this flips three previously failing tests:
- transfer delegates the current Claude session directly to native import
- transfer reports an actionable upgrade error when native import is unsupported
- transfer fails visibly when native import completes without a ledger record
There was a problem hiding this comment.
Pull request overview
This PR makes the transfer runtime tests hermetic on Windows by ensuring the spawned Node process resolves os.homedir() to the test-created temporary home directory (Windows prefers USERPROFILE over HOME).
Changes:
- Set
USERPROFILEalongsideHOMEfor the transfer-related test invocations. - Align environment setup across the transfer tests so path resolution stays within the test temp directory on Windows.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Author
|
Withdrawing this PR. |
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.