fix(qa): avoid live artifact directory collisions · openclaw/openclaw@cdf35e8
vincentkoc
·
2026-06-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -255,6 +255,39 @@ describe("runQaCharacterEval", () => {
|
255 | 255 | expect(report).not.toContain("Judge Raw Reply"); |
256 | 256 | }); |
257 | 257 | |
| 258 | +it("creates a unique default output directory under repo artifacts", async () => { |
| 259 | +const runSuite = vi.fn(async (params: CharacterRunSuiteParams) => |
| 260 | +makeSuiteResult({ |
| 261 | +outputDir: params.outputDir, |
| 262 | +model: params.primaryModel, |
| 263 | +transcript: "USER Alice: hi\n\nASSISTANT openclaw: default dir reply", |
| 264 | +}), |
| 265 | +); |
| 266 | +const runJudge = makeRunJudge([ |
| 267 | +{ |
| 268 | +model: "openai/gpt-5.5", |
| 269 | +rank: 1, |
| 270 | +score: 8, |
| 271 | +summary: "solid", |
| 272 | +strengths: ["clear"], |
| 273 | +weaknesses: [], |
| 274 | +}, |
| 275 | +]); |
| 276 | + |
| 277 | +const result = await runQaCharacterEval({ |
| 278 | +repoRoot: tempRoot, |
| 279 | +models: ["openai/gpt-5.5"], |
| 280 | + runSuite, |
| 281 | + runJudge, |
| 282 | +}); |
| 283 | + |
| 284 | +expect(path.dirname(result.outputDir)).toBe(path.join(tempRoot, ".artifacts", "qa-e2e")); |
| 285 | +expect(path.basename(result.outputDir)).toMatch( |
| 286 | +/^character-eval-[a-z0-9]+-[a-f0-9]{8}$/u, |
| 287 | +); |
| 288 | +await expect(fs.stat(result.reportPath).then((stats) => stats.isFile())).resolves.toBe(true); |
| 289 | +}); |
| 290 | + |
258 | 291 | it("can hide candidate model refs from judge prompts and map rankings back", async () => { |
259 | 292 | const runSuite = vi.fn(async (params: CharacterRunSuiteParams) => |
260 | 293 | makeSuiteResult({ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,6 +3,7 @@ import fs from "node:fs/promises";
|
3 | 3 | import path from "node:path"; |
4 | 4 | import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; |
5 | 5 | import { normalizeStringEntries, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime"; |
| 6 | +import { createQaArtifactRunId } from "./artifact-run-id.js"; |
6 | 7 | import { isQaFastModeModelRef, type QaProviderMode } from "./model-selection.js"; |
7 | 8 | import { |
8 | 9 | QA_FRONTIER_CHARACTER_EVAL_MODELS, |
@@ -520,7 +521,7 @@ export async function runQaCharacterEval(params: QaCharacterEvalParams) {
|
520 | 521 | |
521 | 522 | const outputDir = |
522 | 523 | params.outputDir ?? |
523 | | -path.join(repoRoot, ".artifacts", "qa-e2e", `character-eval-${Date.now().toString(36)}`); |
| 524 | +path.join(repoRoot, ".artifacts", "qa-e2e", `character-eval-${createQaArtifactRunId()}`); |
524 | 525 | const runsDir = path.join(outputDir, "runs"); |
525 | 526 | await fs.mkdir(runsDir, { recursive: true }); |
526 | 527 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -15,6 +15,7 @@ import { writeExternalFileWithinRoot } from "openclaw/plugin-sdk/security-runtim
|
15 | 15 | import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime"; |
16 | 16 | import { chromium } from "playwright-core"; |
17 | 17 | import { z } from "zod"; |
| 18 | +import { createQaArtifactRunId } from "../../artifact-run-id.js"; |
18 | 19 | import { QA_EVIDENCE_FILENAME, buildLiveTransportEvidenceSummary } from "../../evidence-summary.js"; |
19 | 20 | import { startQaGatewayChild } from "../../gateway-child.js"; |
20 | 21 | import { isTruthyOptIn } from "../../mantis-options.runtime.js"; |
@@ -1527,7 +1528,7 @@ export async function runDiscordQaLive(params: {
|
1527 | 1528 | const repoRoot = path.resolve(params.repoRoot ?? process.cwd()); |
1528 | 1529 | const outputDir = |
1529 | 1530 | params.outputDir ?? |
1530 | | -path.join(repoRoot, ".artifacts", "qa-e2e", `discord-${Date.now().toString(36)}`); |
| 1531 | +path.join(repoRoot, ".artifacts", "qa-e2e", `discord-${createQaArtifactRunId()}`); |
1531 | 1532 | await fs.mkdir(outputDir, { recursive: true }); |
1532 | 1533 | |
1533 | 1534 | const providerMode = normalizeQaProviderMode( |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -9,6 +9,7 @@ import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
9 | 9 | import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime"; |
10 | 10 | import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime"; |
11 | 11 | import { z } from "zod"; |
| 12 | +import { createQaArtifactRunId } from "../../artifact-run-id.js"; |
12 | 13 | import { QA_EVIDENCE_FILENAME, buildLiveTransportEvidenceSummary } from "../../evidence-summary.js"; |
13 | 14 | import { startQaGatewayChild } from "../../gateway-child.js"; |
14 | 15 | import { isTruthyOptIn } from "../../mantis-options.runtime.js"; |
@@ -1711,7 +1712,7 @@ export async function runSlackQaLive(params: {
|
1711 | 1712 | const repoRoot = path.resolve(params.repoRoot ?? process.cwd()); |
1712 | 1713 | const outputDir = |
1713 | 1714 | params.outputDir ?? |
1714 | | -path.join(repoRoot, ".artifacts", "qa-e2e", `slack-${Date.now().toString(36)}`); |
| 1715 | +path.join(repoRoot, ".artifacts", "qa-e2e", `slack-${createQaArtifactRunId()}`); |
1715 | 1716 | await fs.mkdir(outputDir, { recursive: true }); |
1716 | 1717 | |
1717 | 1718 | const providerMode = normalizeQaProviderMode( |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,6 +11,7 @@ import {
|
11 | 11 | import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime"; |
12 | 12 | import { isRecord, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime"; |
13 | 13 | import { z } from "zod"; |
| 14 | +import { createQaArtifactRunId } from "../../artifact-run-id.js"; |
14 | 15 | import { |
15 | 16 | QA_EVIDENCE_FILENAME, |
16 | 17 | buildLiveTransportEvidenceSummary, |
@@ -1805,7 +1806,7 @@ export async function runTelegramQaLive(params: {
|
1805 | 1806 | const repoRoot = path.resolve(params.repoRoot ?? process.cwd()); |
1806 | 1807 | const outputDir = |
1807 | 1808 | params.outputDir ?? |
1808 | | -path.join(repoRoot, ".artifacts", "qa-e2e", `telegram-${Date.now().toString(36)}`); |
| 1809 | +path.join(repoRoot, ".artifacts", "qa-e2e", `telegram-${createQaArtifactRunId()}`); |
1809 | 1810 | await fs.mkdir(outputDir, { recursive: true }); |
1810 | 1811 | |
1811 | 1812 | const providerMode = normalizeQaProviderMode( |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -15,6 +15,7 @@ import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
15 | 15 | import { normalizeStringEntries, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime"; |
16 | 16 | import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path"; |
17 | 17 | import { z } from "zod"; |
| 18 | +import { createQaArtifactRunId } from "../../artifact-run-id.js"; |
18 | 19 | import { QA_EVIDENCE_FILENAME, buildLiveTransportEvidenceSummary } from "../../evidence-summary.js"; |
19 | 20 | import { startQaGatewayChild } from "../../gateway-child.js"; |
20 | 21 | import { isTruthyOptIn } from "../../mantis-options.runtime.js"; |
@@ -3033,7 +3034,7 @@ export async function runWhatsAppQaLive(params: {
|
3033 | 3034 | const repoRoot = path.resolve(params.repoRoot ?? process.cwd()); |
3034 | 3035 | const outputDir = |
3035 | 3036 | params.outputDir ?? |
3036 | | -path.join(repoRoot, ".artifacts", "qa-e2e", `whatsapp-${Date.now().toString(36)}`); |
| 3037 | +path.join(repoRoot, ".artifacts", "qa-e2e", `whatsapp-${createQaArtifactRunId()}`); |
3037 | 3038 | await fs.mkdir(outputDir, { recursive: true }); |
3038 | 3039 | |
3039 | 3040 | const providerMode = normalizeQaProviderMode( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。