perf(test): reduce skills + update + memory suite overhead

This commit is contained in:
Peter Steinberger
2026-02-14 15:36:04 +00:00
parent 684c18458a
commit 76e4e9d176
6 changed files with 90 additions and 43 deletions

View File

@@ -1,7 +1,8 @@
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
import {
buildWorkspaceSkillStatus,
type SkillStatusEntry,
@@ -214,6 +215,18 @@ describe("skills-cli", () => {
});
describe("integration: loads real skills from bundled directory", () => {
let tempWorkspaceDir = "";
beforeAll(() => {
tempWorkspaceDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-skills-test-"));
});
afterAll(() => {
if (tempWorkspaceDir) {
fs.rmSync(tempWorkspaceDir, { recursive: true, force: true });
}
});
function resolveBundledSkillsDir(): string | undefined {
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
const root = path.resolve(moduleDir, "..", "..");
@@ -231,7 +244,7 @@ describe("skills-cli", () => {
return;
}
const report = buildWorkspaceSkillStatus("/tmp", {
const report = buildWorkspaceSkillStatus(tempWorkspaceDir, {
managedSkillsDir: "/nonexistent",
});
@@ -257,7 +270,7 @@ describe("skills-cli", () => {
return;
}
const report = buildWorkspaceSkillStatus("/tmp", {
const report = buildWorkspaceSkillStatus(tempWorkspaceDir, {
managedSkillsDir: "/nonexistent",
});