mirror of https://github.com/openclaw/openclaw.git
test(root): reuse temp repo helper in clawhub release tests
This commit is contained in:
parent
b62badd8a3
commit
bcf6e89e90
|
|
@ -1,6 +1,5 @@
|
|||
import { execFileSync } from "node:child_process";
|
||||
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { mkdirSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import {
|
||||
|
|
@ -12,16 +11,12 @@ import {
|
|||
resolveSelectedClawHubPublishablePluginPackages,
|
||||
type PublishablePluginPackage,
|
||||
} from "../scripts/lib/plugin-clawhub-release.ts";
|
||||
import { cleanupTempDirs, makeTempRepoRoot } from "./helpers/temp-repo.js";
|
||||
|
||||
const tempDirs: string[] = [];
|
||||
|
||||
afterEach(() => {
|
||||
while (tempDirs.length > 0) {
|
||||
const dir = tempDirs.pop();
|
||||
if (dir) {
|
||||
rmSync(dir, { recursive: true, force: true });
|
||||
}
|
||||
}
|
||||
cleanupTempDirs(tempDirs);
|
||||
});
|
||||
|
||||
describe("resolveChangedClawHubPublishablePluginPackages", () => {
|
||||
|
|
@ -294,8 +289,7 @@ function createTempPluginRepo(
|
|||
includeClawHubContract?: boolean;
|
||||
} = {},
|
||||
) {
|
||||
const repoDir = mkdtempSync(join(tmpdir(), "openclaw-clawhub-release-"));
|
||||
tempDirs.push(repoDir);
|
||||
const repoDir = makeTempRepoRoot(tempDirs, "openclaw-clawhub-release-");
|
||||
const extensionId = options.extensionId ?? "demo-plugin";
|
||||
const extensionIds = [extensionId, ...(options.extraExtensionIds ?? [])];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue