mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-22 13:08:07 +00:00
test(qa-lab): use temp dir harness in model catalog test
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
// Qa Lab tests cover model catalog plugin behavior.
|
||||
import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import {
|
||||
loadQaRunnerModelOptions,
|
||||
parseQaRunnerModelOptionsOutput,
|
||||
selectQaRunnerModelOptions,
|
||||
} from "./model-catalog.runtime.js";
|
||||
import { createTempDirHarness } from "./temp-dir.test-helper.js";
|
||||
|
||||
const { cleanup, makeTempDir } = createTempDirHarness();
|
||||
|
||||
afterEach(cleanup);
|
||||
|
||||
async function waitForFile(filePath: string, timeoutMs: number): Promise<void> {
|
||||
const deadlineAt = Date.now() + timeoutMs;
|
||||
@@ -103,7 +107,7 @@ describe("qa runner model catalog", () => {
|
||||
it.runIf(process.platform !== "win32")(
|
||||
"kills aborted catalog process groups when the catalog child exits first",
|
||||
async () => {
|
||||
const repoRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-qa-model-catalog-"));
|
||||
const repoRoot = await makeTempDir("openclaw-qa-model-catalog-");
|
||||
const pidPath = path.join(repoRoot, "descendant.pid");
|
||||
let descendantPid: number | undefined;
|
||||
const controller = new AbortController();
|
||||
|
||||
Reference in New Issue
Block a user