@@ -2,8 +2,8 @@ import { spawn } from "node:child_process";
|
2 | 2 | import fs from "node:fs/promises"; |
3 | 3 | import path from "node:path"; |
4 | 4 | import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; |
| 5 | +import { assertQaSuiteArtifactWritten } from "./artifact-assertion.js"; |
5 | 6 | import { isRepoRootRelativeRef, toRepoRelativePath } from "./cli-paths.js"; |
6 | | -import { QaSuiteArtifactError } from "./errors.js"; |
7 | 7 | import { |
8 | 8 | buildPlaywrightEvidenceSummary, |
9 | 9 | buildScriptEvidenceSummary, |
@@ -542,22 +542,10 @@ async function writeTestFileEvidenceFile(params: {
|
542 | 542 | }): Promise<Pick<QaTestFileScenarioRunResult, "evidencePath">> { |
543 | 543 | const evidencePath = path.join(params.outputDir, QA_EVIDENCE_FILENAME); |
544 | 544 | await fs.writeFile(evidencePath, `${JSON.stringify(params.evidence, null, 2)}\n`, "utf8"); |
545 | | -await assertQaTestFileArtifactWritten("evidence", evidencePath); |
| 545 | +await assertQaSuiteArtifactWritten("evidence", evidencePath); |
546 | 546 | return { evidencePath }; |
547 | 547 | } |
548 | 548 | |
549 | | -async function assertQaTestFileArtifactWritten(kind: "evidence", filePath: string) { |
550 | | -try { |
551 | | -await fs.access(filePath); |
552 | | -} catch (error) { |
553 | | -throw new QaSuiteArtifactError( |
554 | | -`${kind}_missing`, |
555 | | -`QA suite did not produce ${kind} artifact at ${filePath}: ${formatErrorMessage(error)}`, |
556 | | -{ cause: error }, |
557 | | -); |
558 | | -} |
559 | | -} |
560 | | - |
561 | 549 | export async function runQaTestFileScenarios( |
562 | 550 | params: QaTestFileScenarioRunParams, |
563 | 551 | ): Promise<QaTestFileScenarioRunResult> { |
|