mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 04:15:48 -06:00
test: route CLI backend fixture env setup
This commit is contained in:
@@ -10,6 +10,7 @@ import { shouldSkipLiveProviderDrift } from "../agents/live-test-provider-drift.
|
||||
import { parseModelRef } from "../agents/model-selection.js";
|
||||
import { clearRuntimeConfigSnapshot, type OpenClawConfig } from "../config/config.js";
|
||||
import { isTruthyEnvValue } from "../infra/env.js";
|
||||
import { setTestEnvValue } from "../test-utils/env.js";
|
||||
import {
|
||||
applyCliBackendLiveEnv,
|
||||
createBootstrapWorkspace,
|
||||
@@ -285,7 +286,7 @@ describeLive("gateway live (cli backend)", () => {
|
||||
applyCliBackendLiveEnv(preservedEnv);
|
||||
|
||||
const token = `test-${randomUUID()}`;
|
||||
process.env.OPENCLAW_GATEWAY_TOKEN = token;
|
||||
setTestEnvValue("OPENCLAW_GATEWAY_TOKEN", token);
|
||||
const port = await getFreeGatewayPort();
|
||||
logCliBackendLiveStep("env-ready", { port });
|
||||
|
||||
@@ -369,7 +370,7 @@ describeLive("gateway live (cli backend)", () => {
|
||||
? await createMcpSchemaProbePlugin(tempDir)
|
||||
: undefined;
|
||||
const useMinimalToolsProfile = providerId === "codex-cli" && !schemaProbePluginPath;
|
||||
process.env.OPENCLAW_STATE_DIR = stateDir;
|
||||
setTestEnvValue("OPENCLAW_STATE_DIR", stateDir);
|
||||
const bundleMcp = backendResolved?.bundleMcp === true;
|
||||
const bootstrapWorkspace = await createBootstrapWorkspace(tempDir);
|
||||
const disableMcpConfig = process.env.OPENCLAW_LIVE_CLI_BACKEND_DISABLE_MCP_CONFIG !== "0";
|
||||
@@ -473,7 +474,7 @@ describeLive("gateway live (cli backend)", () => {
|
||||
};
|
||||
const tempConfigPath = path.join(tempDir, "openclaw.json");
|
||||
await fs.writeFile(tempConfigPath, `${JSON.stringify(nextCfg, null, 2)}\n`);
|
||||
process.env.OPENCLAW_CONFIG_PATH = tempConfigPath;
|
||||
setTestEnvValue("OPENCLAW_CONFIG_PATH", tempConfigPath);
|
||||
const deviceIdentity = await ensurePairedTestGatewayClientIdentity();
|
||||
let server: Awaited<ReturnType<typeof startGatewayServer>> | undefined;
|
||||
let client: Awaited<ReturnType<typeof connectTestGatewayClient>> | undefined;
|
||||
|
||||
Reference in New Issue
Block a user