

























@@ -6,7 +6,7 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
66import type { MigrationApplyResult, MigrationPlan } from "../plugins/types.js";
77import type { RuntimeEnv } from "../runtime.js";
88import { makeTempWorkspace } from "../test-helpers/workspace.js";
9-import { captureEnv } from "../test-utils/env.js";
9+import { captureEnv, deleteTestEnvValue, setTestEnvValue } from "../test-utils/env.js";
1010import { createThrowingRuntime } from "./onboard-non-interactive.test-helpers.js";
1111import type { installGatewayDaemonNonInteractive } from "./onboard-non-interactive/local/daemon-install.js";
1212@@ -336,8 +336,8 @@ describe("onboard (non-interactive): gateway and remote auth", () => {
336336throw new Error("temp home not initialized");
337337}
338338const stateDir = await fs.mkdtemp(path.join(tempHome, prefix));
339-process.env.OPENCLAW_STATE_DIR = stateDir;
340-delete process.env.OPENCLAW_CONFIG_PATH;
339+setTestEnvValue("OPENCLAW_STATE_DIR", stateDir);
340+deleteTestEnvValue("OPENCLAW_CONFIG_PATH");
341341return stateDir;
342342};
343343const withStateDir = async (
@@ -364,16 +364,16 @@ describe("onboard (non-interactive): gateway and remote auth", () => {
364364"OPENCLAW_GATEWAY_TOKEN",
365365"OPENCLAW_GATEWAY_PASSWORD",
366366]);
367-process.env.OPENCLAW_SKIP_CHANNELS = "1";
368-process.env.OPENCLAW_SKIP_GMAIL_WATCHER = "1";
369-process.env.OPENCLAW_SKIP_CRON = "1";
370-process.env.OPENCLAW_SKIP_CANVAS_HOST = "1";
371-process.env.OPENCLAW_SKIP_BROWSER_CONTROL_SERVER = "1";
372-delete process.env.OPENCLAW_GATEWAY_TOKEN;
373-delete process.env.OPENCLAW_GATEWAY_PASSWORD;
367+setTestEnvValue("OPENCLAW_SKIP_CHANNELS", "1");
368+setTestEnvValue("OPENCLAW_SKIP_GMAIL_WATCHER", "1");
369+setTestEnvValue("OPENCLAW_SKIP_CRON", "1");
370+setTestEnvValue("OPENCLAW_SKIP_CANVAS_HOST", "1");
371+setTestEnvValue("OPENCLAW_SKIP_BROWSER_CONTROL_SERVER", "1");
372+deleteTestEnvValue("OPENCLAW_GATEWAY_TOKEN");
373+deleteTestEnvValue("OPENCLAW_GATEWAY_PASSWORD");
374374375375tempHome = await makeTempWorkspace("openclaw-onboard-");
376-process.env.HOME = tempHome;
376+setTestEnvValue("HOME", tempHome);
377377378378await loadGatewayOnboardModules();
379379});
@@ -969,8 +969,8 @@ describe("onboard (non-interactive): gateway and remote auth", () => {
969969return;
970970}
971971await withStateDir("state-lan-", async (stateDir) => {
972-process.env.OPENCLAW_STATE_DIR = stateDir;
973-process.env.OPENCLAW_CONFIG_PATH = path.join(stateDir, "openclaw.json");
972+setTestEnvValue("OPENCLAW_STATE_DIR", stateDir);
973+setTestEnvValue("OPENCLAW_CONFIG_PATH", path.join(stateDir, "openclaw.json"));
974974975975const port = getPseudoPort(40_000);
976976const workspace = path.join(stateDir, "openclaw");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。