mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
fix(qa): anchor runner artifacts to repo root
This commit is contained in:
committed by
Peter Steinberger
parent
daeff2fa89
commit
f6544a0a3b
@@ -651,6 +651,7 @@ export async function startQaLabServer(params?: {
|
||||
state,
|
||||
cfg: gateway?.cfg ?? createQaLabConfig(listenUrl),
|
||||
outputPath: params?.outputPath,
|
||||
repoRoot,
|
||||
});
|
||||
latestScenarioRun = withQaLabRunCounts({
|
||||
kind: "self-check",
|
||||
@@ -698,7 +699,7 @@ export async function startQaLabServer(params?: {
|
||||
const { runQaSuiteFromRuntime } = await import("./suite-launch.runtime.js");
|
||||
const result = await runQaSuiteFromRuntime({
|
||||
lab: labHandle ?? undefined,
|
||||
outputDir: createQaRunOutputDir(),
|
||||
outputDir: createQaRunOutputDir(repoRoot),
|
||||
providerMode: selection.providerMode,
|
||||
primaryModel: selection.primaryModel,
|
||||
alternateModel: selection.alternateModel,
|
||||
|
||||
@@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
createDefaultQaRunSelection,
|
||||
createIdleQaRunnerSnapshot,
|
||||
createQaRunOutputDir,
|
||||
normalizeQaRunSelection,
|
||||
} from "./run-config.js";
|
||||
|
||||
@@ -67,4 +68,9 @@ describe("qa run config", () => {
|
||||
).scenarioIds,
|
||||
).toEqual(["dm-chat-baseline", "thread-lifecycle"]);
|
||||
});
|
||||
|
||||
it("anchors generated run output dirs under the provided repo root", () => {
|
||||
const outputDir = createQaRunOutputDir("/tmp/openclaw-repo");
|
||||
expect(outputDir.startsWith("/tmp/openclaw-repo/.artifacts/qa-e2e/lab-")).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
19
extensions/qa-lab/src/self-check.test.ts
Normal file
19
extensions/qa-lab/src/self-check.test.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolveQaSelfCheckOutputPath } from "./self-check.js";
|
||||
|
||||
describe("resolveQaSelfCheckOutputPath", () => {
|
||||
it("keeps explicit output paths untouched", () => {
|
||||
expect(
|
||||
resolveQaSelfCheckOutputPath({
|
||||
repoRoot: "/tmp/openclaw-repo",
|
||||
outputPath: "/tmp/custom/self-check.md",
|
||||
}),
|
||||
).toBe("/tmp/custom/self-check.md");
|
||||
});
|
||||
|
||||
it("anchors default self-check reports under the provided repo root", () => {
|
||||
expect(resolveQaSelfCheckOutputPath({ repoRoot: "/tmp/openclaw-repo" })).toBe(
|
||||
"/tmp/openclaw-repo/.artifacts/qa-e2e/self-check.md",
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -14,10 +14,19 @@ export type QaSelfCheckResult = {
|
||||
scenarioResult: QaScenarioResult;
|
||||
};
|
||||
|
||||
export function resolveQaSelfCheckOutputPath(params?: { outputPath?: string; repoRoot?: string }) {
|
||||
if (params?.outputPath) {
|
||||
return params.outputPath;
|
||||
}
|
||||
const repoRoot = path.resolve(params?.repoRoot ?? process.cwd());
|
||||
return path.join(repoRoot, ".artifacts", "qa-e2e", "self-check.md");
|
||||
}
|
||||
|
||||
export async function runQaSelfCheckAgainstState(params: {
|
||||
state: QaBusState;
|
||||
cfg: OpenClawConfig;
|
||||
outputPath?: string;
|
||||
repoRoot?: string;
|
||||
notes?: string[];
|
||||
}): Promise<QaSelfCheckResult> {
|
||||
const startedAt = new Date();
|
||||
@@ -64,8 +73,10 @@ export async function runQaSelfCheckAgainstState(params: {
|
||||
],
|
||||
});
|
||||
|
||||
const outputPath =
|
||||
params.outputPath ?? path.join(process.cwd(), ".artifacts", "qa-e2e", "self-check.md");
|
||||
const outputPath = resolveQaSelfCheckOutputPath({
|
||||
outputPath: params.outputPath,
|
||||
repoRoot: params.repoRoot,
|
||||
});
|
||||
await fs.mkdir(path.dirname(outputPath), { recursive: true });
|
||||
await fs.writeFile(outputPath, report, "utf8");
|
||||
|
||||
@@ -77,8 +88,9 @@ export async function runQaSelfCheckAgainstState(params: {
|
||||
};
|
||||
}
|
||||
|
||||
export async function runQaLabSelfCheck(params?: { outputPath?: string }) {
|
||||
export async function runQaLabSelfCheck(params?: { repoRoot?: string; outputPath?: string }) {
|
||||
const server = await startQaLabServer({
|
||||
repoRoot: params?.repoRoot,
|
||||
outputPath: params?.outputPath,
|
||||
});
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user