mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 13:05:01 +00:00
test(perf): trim qmd manager fixture setup overhead
This commit is contained in:
@@ -131,11 +131,12 @@ describe("QmdMemoryManager", () => {
|
|||||||
logDebugMock.mockClear();
|
logDebugMock.mockClear();
|
||||||
logInfoMock.mockClear();
|
logInfoMock.mockClear();
|
||||||
tmpRoot = path.join(fixtureRoot, `case-${fixtureCount++}`);
|
tmpRoot = path.join(fixtureRoot, `case-${fixtureCount++}`);
|
||||||
await fs.mkdir(tmpRoot);
|
|
||||||
workspaceDir = path.join(tmpRoot, "workspace");
|
workspaceDir = path.join(tmpRoot, "workspace");
|
||||||
await fs.mkdir(workspaceDir);
|
|
||||||
stateDir = path.join(tmpRoot, "state");
|
stateDir = path.join(tmpRoot, "state");
|
||||||
await fs.mkdir(stateDir);
|
await Promise.all([
|
||||||
|
fs.mkdir(workspaceDir, { recursive: true }),
|
||||||
|
fs.mkdir(stateDir, { recursive: true }),
|
||||||
|
]);
|
||||||
process.env.OPENCLAW_STATE_DIR = stateDir;
|
process.env.OPENCLAW_STATE_DIR = stateDir;
|
||||||
cfg = {
|
cfg = {
|
||||||
agents: {
|
agents: {
|
||||||
@@ -152,7 +153,7 @@ describe("QmdMemoryManager", () => {
|
|||||||
} as OpenClawConfig;
|
} as OpenClawConfig;
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(async () => {
|
afterEach(() => {
|
||||||
vi.useRealTimers();
|
vi.useRealTimers();
|
||||||
delete process.env.OPENCLAW_STATE_DIR;
|
delete process.env.OPENCLAW_STATE_DIR;
|
||||||
delete (globalThis as Record<string, unknown>).__openclawMcporterDaemonStart;
|
delete (globalThis as Record<string, unknown>).__openclawMcporterDaemonStart;
|
||||||
|
|||||||
Reference in New Issue
Block a user