From 042b7d5ecc33aaca84c5bef84e318ecdcbac80e6 Mon Sep 17 00:00:00 2001 From: NagyVikt Date: Thu, 25 Jun 2026 13:00:26 +0200 Subject: [PATCH] test(ci): isolate Windows sandbox home in json-parity tests os.homedir() ignores HOME on Windows and reads USERPROFILE, so each withSandbox call leaked into the real home dir. Accounts added by one test (account1+account2) bled into the next, so 'parallel install writes Fish functions' saw 2 stale profiles and asserted 1. Set USERPROFILE alongside HOME to keep the sandbox isolated on every platform. --- src/tests/json-parity.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tests/json-parity.test.ts b/src/tests/json-parity.test.ts index 91f9d55..08c17db 100644 --- a/src/tests/json-parity.test.ts +++ b/src/tests/json-parity.test.ts @@ -157,6 +157,11 @@ async function withSandbox(fn: (env: NodeJS.ProcessEnv) => Promise): Promi const env: NodeJS.ProcessEnv = { ...process.env, HOME: tempHome, + // `os.homedir()` ignores HOME on Windows and reads USERPROFILE instead, so + // without this the sandbox leaks into the real home dir and accounts bleed + // across tests (parallel install then sees stale profiles). Setting both + // keeps the sandbox isolated on every platform. + USERPROFILE: tempHome, CODEX_AUTH_CODEX_DIR: codexDir, // Make oclif treat stdout as non-TTY so the update-notifier hook stays // quiet and no color codes leak into stdout.