@@ -250,10 +250,10 @@ docker_build_transient_failure "$LOG_PATH"
|
250 | 250 | const cleanupRun = readFileSync(CLEANUP_SMOKE_RUN_PATH, "utf8"); |
251 | 251 | |
252 | 252 | expect(cleanupRun).toContain("ensure_cleanup_smoke_node_options()"); |
253 | | -expect(cleanupRun).toContain("export NODE_OPTIONS=\"$current\""); |
| 253 | +expect(cleanupRun).toContain('export NODE_OPTIONS="$current"'); |
254 | 254 | expect(cleanupRun).toContain("--max-old-space-size=8192"); |
255 | | -expect(cleanupRun).toContain("*\" --max-old-space-size=\"*"); |
256 | | -expect(cleanupRun).toContain("*\" --max_old_space_size=\"*"); |
| 255 | +expect(cleanupRun).toContain('*" --max-old-space-size="*'); |
| 256 | +expect(cleanupRun).toContain('*" --max_old_space_size="*'); |
257 | 257 | expect(cleanupRun.indexOf("ensure_cleanup_smoke_node_options")).toBeLessThan( |
258 | 258 | cleanupRun.indexOf("pnpm build >/tmp/openclaw-cleanup-build.log"), |
259 | 259 | ); |
@@ -3232,21 +3232,43 @@ output="$(cat "$sampler_log")"
|
3232 | 3232 | expect(result.stderr).not.toContain("Docker image not found"); |
3233 | 3233 | }); |
3234 | 3234 | |
3235 | | -it("rejects invalid OpenAI chat tools Docker timeouts before auth setup", () => { |
| 3235 | +it.each([ |
| 3236 | +["timeout", "OPENCLAW_OPENAI_CHAT_TOOLS_TIMEOUT_SECONDS", "180s"], |
| 3237 | +["body cap", "OPENCLAW_OPENAI_CHAT_TOOLS_MAX_BODY_BYTES", "64kb"], |
| 3238 | +])("rejects invalid OpenAI chat tools Docker %s before auth setup", (_label, envName, value) => { |
3236 | 3239 | const result = spawnSync("bash", [OPENAI_CHAT_TOOLS_DOCKER_E2E_PATH], { |
3237 | 3240 | encoding: "utf8", |
3238 | 3241 | env: { |
3239 | 3242 | ...process.env, |
3240 | 3243 | OPENAI_API_KEY: "", |
3241 | | -OPENCLAW_OPENAI_CHAT_TOOLS_TIMEOUT_SECONDS: "180s", |
| 3244 | +[envName]: value, |
3242 | 3245 | }, |
3243 | 3246 | }); |
3244 | 3247 | |
3245 | 3248 | expect(result.status).toBe(2); |
3246 | | -expect(result.stderr).toContain("invalid OPENCLAW_OPENAI_CHAT_TOOLS_TIMEOUT_SECONDS: 180s"); |
| 3249 | +expect(result.stderr).toContain(`invalid ${envName}: ${value}`); |
3247 | 3250 | expect(result.stderr).not.toContain("OPENAI_API_KEY was not available"); |
3248 | 3251 | }); |
3249 | 3252 | |
| 3253 | +it("forwards every OpenAI chat tools runtime env knob into Docker", () => { |
| 3254 | +const runner = readFileSync(OPENAI_CHAT_TOOLS_DOCKER_E2E_PATH, "utf8"); |
| 3255 | +const client = readFileSync("scripts/e2e/lib/openai-chat-tools/client.mjs", "utf8"); |
| 3256 | +const writer = readFileSync("scripts/e2e/lib/openai-chat-tools/write-config.mjs", "utf8"); |
| 3257 | +const consumed = new Set( |
| 3258 | +[...`${client}\n${writer}`.matchAll(/["`](OPENCLAW_OPENAI_CHAT_TOOLS_[A-Z0-9_]+)["`]/gu)].map( |
| 3259 | +(match) => match[1], |
| 3260 | +), |
| 3261 | +); |
| 3262 | +const forwarded = new Set( |
| 3263 | +[...runner.matchAll(/-e\s+"(OPENCLAW_OPENAI_CHAT_TOOLS_[A-Z0-9_]+)=/gu)].map( |
| 3264 | +(match) => match[1], |
| 3265 | +), |
| 3266 | +); |
| 3267 | +const missing = [...consumed].filter((envName) => !forwarded.has(envName)).toSorted(); |
| 3268 | + |
| 3269 | +expect(missing).toEqual([]); |
| 3270 | +}); |
| 3271 | + |
3250 | 3272 | it("forwards every kitchen-sink RPC runtime env knob into Docker", () => { |
3251 | 3273 | const runner = readFileSync(KITCHEN_SINK_RPC_DOCKER_E2E_PATH, "utf8"); |
3252 | 3274 | const walk = readFileSync("scripts/e2e/kitchen-sink-rpc-walk.mjs", "utf8"); |
|