

























@@ -46,6 +46,11 @@ import { readQaScenarioPack } from "./scenario-catalog.js";
4646import { resolveQaScenarioPackScenarioIds } from "./scenario-packs.js";
4747import { runQaSuiteFromRuntime } from "./suite-launch.runtime.js";
4848import { readQaSuiteFailedScenarioCountFromSummary } from "./suite-summary.js";
49+import {
50+buildQaToolCoverageReport,
51+renderQaToolCoverageMarkdownReport,
52+type QaToolCoverageSuiteSummary,
53+} from "./tool-coverage-report.js";
49545055const QA_SUITE_INFRA_RETRY_LIMIT = 1;
5156@@ -694,18 +699,39 @@ export async function runQaCoverageReportCommand(opts: {
694699repoRoot?: string;
695700output?: string;
696701json?: boolean;
702+tools?: boolean;
703+summary?: string;
697704}) {
698705const repoRoot = path.resolve(opts.repoRoot ?? process.cwd());
699-const inventory = buildQaCoverageInventory(readQaScenarioPack().scenarios);
700706const outputPath = opts.output ? path.resolve(repoRoot, opts.output) : undefined;
701-const body = opts.json
702- ? `${JSON.stringify(inventory, null, 2)}\n`
703- : renderQaCoverageMarkdownReport(inventory);
707+const scenarios = readQaScenarioPack().scenarios;
708+let body: string;
709+let outputLabel = "QA coverage report";
710+if (opts.tools === true) {
711+const summary = opts.summary?.trim()
712+ ? (JSON.parse(
713+await fs.readFile(path.resolve(repoRoot, opts.summary), "utf8"),
714+) as QaToolCoverageSuiteSummary)
715+ : undefined;
716+const report = buildQaToolCoverageReport({ scenarios, summary });
717+body = opts.json
718+ ? `${JSON.stringify(report, null, 2)}\n`
719+ : renderQaToolCoverageMarkdownReport(report);
720+outputLabel = "QA tool coverage report";
721+} else {
722+if (opts.summary?.trim()) {
723+throw new Error("--summary requires --tools.");
724+}
725+const inventory = buildQaCoverageInventory(scenarios);
726+body = opts.json
727+ ? `${JSON.stringify(inventory, null, 2)}\n`
728+ : renderQaCoverageMarkdownReport(inventory);
729+}
704730705731if (outputPath) {
706732await fs.mkdir(path.dirname(outputPath), { recursive: true });
707733await fs.writeFile(outputPath, body, "utf8");
708-process.stdout.write(`QA coverage report: ${outputPath}\n`);
734+process.stdout.write(`${outputLabel}: ${outputPath}\n`);
709735return;
710736}
711737此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。