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