Tests: use preferred tmp dir in acpx runtime fixtures

This commit is contained in:
Onur 2026-03-01 17:50:47 +01:00 committed by Onur Solmaz
parent ca31683ca3
commit 6c08652c8d
1 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import fs from "node:fs";
import { chmod, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { resolvePreferredOpenClawTmpDir } from "../../../../src/infra/tmp-openclaw-dir.js";
import type { ResolvedAcpxPluginConfig } from "../config.js";
import { ACPX_PINNED_VERSION } from "../config.js";
import { AcpxRuntime } from "../runtime.js";
@ -255,7 +255,9 @@ export async function createMockRuntimeFixture(params?: {
logPath: string;
config: ResolvedAcpxPluginConfig;
}> {
const dir = await mkdtemp(path.join(os.tmpdir(), "openclaw-acpx-runtime-test-"));
const dir = await mkdtemp(
path.join(resolvePreferredOpenClawTmpDir(), "openclaw-acpx-runtime-test-"),
);
tempDirs.push(dir);
const scriptPath = path.join(dir, "mock-acpx.cjs");
const logPath = path.join(dir, "calls.log");