mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-13 11:26:10 +00:00
fix(qa): trust parity scenario rows for metrics
This commit is contained in:
@@ -135,6 +135,27 @@ describe("qa agentic parity report", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("uses scenario rows rather than stale summary counts for parity metrics", () => {
|
||||
const summary: QaParitySuiteSummary = {
|
||||
counts: {
|
||||
total: 2,
|
||||
passed: 2,
|
||||
failed: 0,
|
||||
},
|
||||
scenarios: [
|
||||
{ name: "Approval turn tool followthrough", status: "pass" },
|
||||
{ name: "Compaction retry after mutating tool", status: "fail" },
|
||||
],
|
||||
};
|
||||
|
||||
const metrics = computeQaAgenticParityMetrics(summary);
|
||||
|
||||
expect(metrics.totalScenarios).toBe(2);
|
||||
expect(metrics.passedScenarios).toBe(1);
|
||||
expect(metrics.failedScenarios).toBe(1);
|
||||
expect(metrics.completionRate).toBe(0.5);
|
||||
});
|
||||
|
||||
it("keeps non-tool scenarios out of the valid-tool-call metric", () => {
|
||||
const summary: QaParitySuiteSummary = {
|
||||
scenarios: [
|
||||
|
||||
@@ -177,11 +177,9 @@ export function computeQaAgenticParityMetrics(
|
||||
const toolBackedTitleSet: ReadonlySet<string> = new Set(
|
||||
QA_AGENTIC_PARITY_TOOL_BACKED_SCENARIO_TITLES,
|
||||
);
|
||||
const totalScenarios = summary.counts?.total ?? scenarios.length;
|
||||
const passedScenarios =
|
||||
summary.counts?.passed ?? scenarios.filter((scenario) => scenario.status === "pass").length;
|
||||
const failedScenarios =
|
||||
summary.counts?.failed ?? scenarios.filter((scenario) => scenario.status === "fail").length;
|
||||
const totalScenarios = scenarios.length;
|
||||
const passedScenarios = scenarios.filter((scenario) => scenario.status === "pass").length;
|
||||
const failedScenarios = scenarios.filter((scenario) => scenario.status === "fail").length;
|
||||
const unintendedStopCount = scenarios.filter(
|
||||
(scenario) =>
|
||||
scenario.status !== "pass" && scenarioHasPattern(scenario, UNINTENDED_STOP_PATTERNS),
|
||||
|
||||
Reference in New Issue
Block a user