mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-17 12:11:20 +00:00
* fix(ci): route messaging temp files through openclaw tmp dir * fix(ci): clear qa-lab follow-up guardrails * fix(ci): own-check ACP fallback resolvers * fix(ci): preserve memory-core write error causes * fix(ci): narrow qa-channel boundary alias * fix(test): type memory-core dreaming api stubs
33 lines
853 B
TypeScript
33 lines
853 B
TypeScript
import fs from "node:fs/promises";
|
|
import path from "node:path";
|
|
import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path";
|
|
import { afterAll, beforeAll } from "vitest";
|
|
|
|
export function createMemoryCoreTestHarness() {
|
|
let fixtureRoot = "";
|
|
let caseId = 0;
|
|
|
|
beforeAll(async () => {
|
|
fixtureRoot = await fs.mkdtemp(
|
|
path.join(resolvePreferredOpenClawTmpDir(), "memory-core-test-fixtures-"),
|
|
);
|
|
});
|
|
|
|
afterAll(async () => {
|
|
if (!fixtureRoot) {
|
|
return;
|
|
}
|
|
await fs.rm(fixtureRoot, { recursive: true, force: true });
|
|
});
|
|
|
|
async function createTempWorkspace(prefix: string): Promise<string> {
|
|
const workspaceDir = path.join(fixtureRoot, `${prefix}${caseId++}`);
|
|
await fs.mkdir(workspaceDir, { recursive: true });
|
|
return workspaceDir;
|
|
}
|
|
|
|
return {
|
|
createTempWorkspace,
|
|
};
|
|
}
|