From 60afca187d16160ca380d3bd62d904bdbbd287d4 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Tue, 26 May 2026 01:36:05 +0200 Subject: [PATCH] fix(test): isolate kitchen sink rpc home env --- scripts/e2e/kitchen-sink-rpc-walk.mjs | 3 ++- test/scripts/kitchen-sink-rpc-walk.test.ts | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/e2e/kitchen-sink-rpc-walk.mjs b/scripts/e2e/kitchen-sink-rpc-walk.mjs index e5d0d3418b7..fc3967cde10 100644 --- a/scripts/e2e/kitchen-sink-rpc-walk.mjs +++ b/scripts/e2e/kitchen-sink-rpc-walk.mjs @@ -68,7 +68,8 @@ export function makeEnv() { env: { ...process.env, HOME: home, - OPENCLAW_HOME: stateDir, + USERPROFILE: home, + OPENCLAW_HOME: home, OPENCLAW_STATE_DIR: stateDir, OPENCLAW_CONFIG_PATH: path.join(stateDir, "openclaw.json"), OPENCLAW_NO_ONBOARD: "1", diff --git a/test/scripts/kitchen-sink-rpc-walk.test.ts b/test/scripts/kitchen-sink-rpc-walk.test.ts index ee04863639a..6e762015eb8 100644 --- a/test/scripts/kitchen-sink-rpc-walk.test.ts +++ b/test/scripts/kitchen-sink-rpc-walk.test.ts @@ -21,7 +21,12 @@ describe("kitchen-sink RPC isolated state", () => { const { root, env } = makeEnv(); expect(root).toContain("openclaw-kitchen-sink-rpc-"); - expect(existsSync(env.OPENCLAW_HOME)).toBe(true); + expect(env.HOME).toBe(path.join(root, "home")); + expect(env.USERPROFILE).toBe(env.HOME); + expect(env.OPENCLAW_HOME).toBe(env.HOME); + expect(env.OPENCLAW_STATE_DIR).toBe(path.join(env.HOME, ".openclaw")); + expect(env.OPENCLAW_CONFIG_PATH).toBe(path.join(env.OPENCLAW_STATE_DIR, "openclaw.json")); + expect(existsSync(env.OPENCLAW_STATE_DIR)).toBe(true); await expect(cleanupKitchenSinkEnv(root)).resolves.toBe(true);