test: isolate launcher compile cache temp · openclaw/openclaw@becfeb4
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -336,6 +336,7 @@ describe("openclaw launcher", () => {
|
336 | 336 | it("falls back to the default packaged launcher compile cache when NODE_COMPILE_CACHE is empty", async () => { |
337 | 337 | const fixtureRoot = await makeLauncherFixture(fixtureRoots); |
338 | 338 | const runCwd = makeTempDir(fixtureRoots, "openclaw-launcher-cwd-"); |
| 339 | +const tmpRoot = makeTempDir(fixtureRoots, "openclaw-launcher-tmp-"); |
339 | 340 | await fs.writeFile(path.join(fixtureRoot, "package.json"), '{"version":"2026.4.29"}\n'); |
340 | 341 | await fs.writeFile( |
341 | 342 | path.join(fixtureRoot, "dist", "entry.js"), |
@@ -350,6 +351,9 @@ describe("openclaw launcher", () => {
|
350 | 351 | cwd: runCwd, |
351 | 352 | env: launcherEnv({ |
352 | 353 | NODE_COMPILE_CACHE: "", |
| 354 | +TMP: tmpRoot, |
| 355 | +TEMP: tmpRoot, |
| 356 | +TMPDIR: tmpRoot, |
353 | 357 | }), |
354 | 358 | encoding: "utf8", |
355 | 359 | }); |
@@ -361,11 +365,16 @@ describe("openclaw launcher", () => {
|
361 | 365 | |
362 | 366 | it("enables compile cache for packaged launchers", async () => { |
363 | 367 | const fixtureRoot = await makeLauncherFixture(fixtureRoots); |
| 368 | +const tmpRoot = makeTempDir(fixtureRoots, "openclaw-launcher-tmp-"); |
364 | 369 | await addCompileCacheProbe(fixtureRoot); |
365 | 370 | |
366 | 371 | const result = spawnSync(process.execPath, [path.join(fixtureRoot, "openclaw.mjs")], { |
367 | 372 | cwd: fixtureRoot, |
368 | | -env: launcherEnv(), |
| 373 | +env: launcherEnv({ |
| 374 | +TMP: tmpRoot, |
| 375 | +TEMP: tmpRoot, |
| 376 | +TMPDIR: tmpRoot, |
| 377 | +}), |
369 | 378 | encoding: "utf8", |
370 | 379 | }); |
371 | 380 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。