test: harden plugin env-scoped fixtures
This commit is contained in:
@@ -41,7 +41,10 @@ describe("config plugin validation", () => {
|
|||||||
const suiteEnv = () =>
|
const suiteEnv = () =>
|
||||||
({
|
({
|
||||||
...process.env,
|
...process.env,
|
||||||
|
HOME: suiteHome,
|
||||||
|
OPENCLAW_HOME: undefined,
|
||||||
OPENCLAW_STATE_DIR: path.join(suiteHome, ".openclaw"),
|
OPENCLAW_STATE_DIR: path.join(suiteHome, ".openclaw"),
|
||||||
|
CLAWDBOT_STATE_DIR: undefined,
|
||||||
OPENCLAW_PLUGIN_MANIFEST_CACHE_MS: "10000",
|
OPENCLAW_PLUGIN_MANIFEST_CACHE_MS: "10000",
|
||||||
}) satisfies NodeJS.ProcessEnv;
|
}) satisfies NodeJS.ProcessEnv;
|
||||||
|
|
||||||
|
|||||||
@@ -214,6 +214,7 @@ describe("applyPluginAutoEnable", () => {
|
|||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
|
OPENCLAW_HOME: undefined,
|
||||||
OPENCLAW_STATE_DIR: stateDir,
|
OPENCLAW_STATE_DIR: stateDir,
|
||||||
CLAWDBOT_STATE_DIR: undefined,
|
CLAWDBOT_STATE_DIR: undefined,
|
||||||
OPENCLAW_BUNDLED_PLUGINS_DIR: "/nonexistent/bundled/plugins",
|
OPENCLAW_BUNDLED_PLUGINS_DIR: "/nonexistent/bundled/plugins",
|
||||||
@@ -439,6 +440,7 @@ describe("applyPluginAutoEnable", () => {
|
|||||||
config: makeApnChannelConfig(),
|
config: makeApnChannelConfig(),
|
||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
|
OPENCLAW_HOME: undefined,
|
||||||
OPENCLAW_STATE_DIR: stateDir,
|
OPENCLAW_STATE_DIR: stateDir,
|
||||||
CLAWDBOT_STATE_DIR: undefined,
|
CLAWDBOT_STATE_DIR: undefined,
|
||||||
OPENCLAW_BUNDLED_PLUGINS_DIR: "/nonexistent/bundled/plugins",
|
OPENCLAW_BUNDLED_PLUGINS_DIR: "/nonexistent/bundled/plugins",
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ function makeTempDir() {
|
|||||||
|
|
||||||
function buildDiscoveryEnv(stateDir: string): NodeJS.ProcessEnv {
|
function buildDiscoveryEnv(stateDir: string): NodeJS.ProcessEnv {
|
||||||
return {
|
return {
|
||||||
...process.env,
|
|
||||||
OPENCLAW_STATE_DIR: stateDir,
|
OPENCLAW_STATE_DIR: stateDir,
|
||||||
CLAWDBOT_STATE_DIR: undefined,
|
CLAWDBOT_STATE_DIR: undefined,
|
||||||
|
OPENCLAW_HOME: undefined,
|
||||||
OPENCLAW_BUNDLED_PLUGINS_DIR: "/nonexistent/bundled/plugins",
|
OPENCLAW_BUNDLED_PLUGINS_DIR: "/nonexistent/bundled/plugins",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -540,6 +540,7 @@ describe("loadOpenClawPlugins", () => {
|
|||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
HOME: homeA,
|
HOME: homeA,
|
||||||
|
OPENCLAW_HOME: undefined,
|
||||||
OPENCLAW_STATE_DIR: stateDir,
|
OPENCLAW_STATE_DIR: stateDir,
|
||||||
OPENCLAW_BUNDLED_PLUGINS_DIR: bundledDir,
|
OPENCLAW_BUNDLED_PLUGINS_DIR: bundledDir,
|
||||||
},
|
},
|
||||||
@@ -549,6 +550,7 @@ describe("loadOpenClawPlugins", () => {
|
|||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
HOME: homeB,
|
HOME: homeB,
|
||||||
|
OPENCLAW_HOME: undefined,
|
||||||
OPENCLAW_STATE_DIR: stateDir,
|
OPENCLAW_STATE_DIR: stateDir,
|
||||||
OPENCLAW_BUNDLED_PLUGINS_DIR: bundledDir,
|
OPENCLAW_BUNDLED_PLUGINS_DIR: bundledDir,
|
||||||
},
|
},
|
||||||
@@ -679,6 +681,7 @@ describe("loadOpenClawPlugins", () => {
|
|||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
HOME: homeDir,
|
HOME: homeDir,
|
||||||
|
OPENCLAW_HOME: undefined,
|
||||||
OPENCLAW_BUNDLED_PLUGINS_DIR: override,
|
OPENCLAW_BUNDLED_PLUGINS_DIR: override,
|
||||||
},
|
},
|
||||||
config: {
|
config: {
|
||||||
@@ -1814,6 +1817,7 @@ describe("loadOpenClawPlugins", () => {
|
|||||||
cwd: process.cwd(),
|
cwd: process.cwd(),
|
||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
|
OPENCLAW_HOME: undefined,
|
||||||
OPENCLAW_BUNDLED_PLUGINS_DIR: "/nonexistent/bundled/plugins",
|
OPENCLAW_BUNDLED_PLUGINS_DIR: "/nonexistent/bundled/plugins",
|
||||||
},
|
},
|
||||||
encoding: "utf-8",
|
encoding: "utf-8",
|
||||||
|
|||||||
@@ -346,6 +346,7 @@ describe("loadPluginManifestRegistry", () => {
|
|||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
HOME: homeA,
|
HOME: homeA,
|
||||||
|
OPENCLAW_HOME: undefined,
|
||||||
OPENCLAW_STATE_DIR: path.join(homeA, ".state"),
|
OPENCLAW_STATE_DIR: path.join(homeA, ".state"),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -355,6 +356,7 @@ describe("loadPluginManifestRegistry", () => {
|
|||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
HOME: homeB,
|
HOME: homeB,
|
||||||
|
OPENCLAW_HOME: undefined,
|
||||||
OPENCLAW_STATE_DIR: path.join(homeB, ".state"),
|
OPENCLAW_STATE_DIR: path.join(homeB, ".state"),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user