@@ -11,6 +11,7 @@ import { stageQaMockAuthProfiles } from "../extensions/qa-lab/src/providers/shar
|
11 | 11 | import { buildQaGatewayConfig } from "../extensions/qa-lab/src/qa-gateway-config.js"; |
12 | 12 | import { resetConfigRuntimeState } from "../src/config/config.js"; |
13 | 13 | import { startGatewayServer } from "../src/gateway/server.js"; |
| 14 | +import { deleteTestEnvValue, setTestEnvValue } from "../src/test-utils/env.js"; |
14 | 15 | import { writeProbeMcpServer } from "./e2e/lib/mcp-code-mode-probe-server.ts"; |
15 | 16 | import { |
16 | 17 | type McpCodeModeMentions, |
@@ -87,9 +88,9 @@ async function readSessionLogMentions(stateDir: string): Promise<Record<string,
|
87 | 88 | |
88 | 89 | function restoreEnvValue(key: string, value: string | undefined): void { |
89 | 90 | if (value === undefined) { |
90 | | -delete process.env[key]; |
| 91 | +deleteTestEnvValue(key); |
91 | 92 | } else { |
92 | | -process.env[key] = value; |
| 93 | +setTestEnvValue(key, value); |
93 | 94 | } |
94 | 95 | } |
95 | 96 | |
@@ -203,9 +204,9 @@ export async function main() {
|
203 | 204 | serverPath, |
204 | 205 | }); |
205 | 206 | |
206 | | -process.env.OPENCLAW_STATE_DIR = stateDir; |
207 | | -process.env.OPENCLAW_CONFIG_PATH = configPath; |
208 | | -process.env.OPENCLAW_TEST_FAST = "1"; |
| 207 | +setTestEnvValue("OPENCLAW_STATE_DIR", stateDir); |
| 208 | +setTestEnvValue("OPENCLAW_CONFIG_PATH", configPath); |
| 209 | +setTestEnvValue("OPENCLAW_TEST_FAST", "1"); |
209 | 210 | resetConfigRuntimeState(); |
210 | 211 | |
211 | 212 | server = await startGatewayServer(gatewayPort, { |
|