mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-31 14:16:39 +01:00
fix(reports): keep never-run allowance consistent
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
e8686bf373
commit
f813c18deb
2 files changed
+5
-1
No files matched your search
@@ -73,6 +73,10 @@ describe("display-only catalog overview", () => {
|
|||||||
expect(doc.querySelector('.summary')!.textContent).toContain('25Recorded feature-work passes');
|
expect(doc.querySelector('.summary')!.textContent).toContain('25Recorded feature-work passes');
|
||||||
expect(() => parseCatalogOverview({...data,accounting:{...data.accounting,exhaustedFinals:104}})).toThrow('Inconsistent catalog accounting');
|
expect(() => parseCatalogOverview({...data,accounting:{...data.accounting,exhaustedFinals:104}})).toThrow('Inconsistent catalog accounting');
|
||||||
});
|
});
|
||||||
|
it("rejects unknown allowance when execution is positively known never-run", () => {
|
||||||
|
const data=fixture(); data.rows[169]!.allowance="unknown";
|
||||||
|
expect(() => parseCatalogOverview(data)).toThrow('Inconsistent recorded execution scope');
|
||||||
|
});
|
||||||
it("shows a later candidate pass without promoting the recorded main failure", () => {
|
it("shows a later candidate pass without promoting the recorded main failure", () => {
|
||||||
const data=fixture(); data.rows[25]!.latestCandidateOutcome="passed";
|
const data=fixture(); data.rows[25]!.latestCandidateOutcome="passed";
|
||||||
const doc=new JSDOM(page(data)).window.document,row=doc.getElementById('catalog-'+data.rows[25]!.scenarioId)!;
|
const doc=new JSDOM(page(data)).window.document,row=doc.getElementById('catalog-'+data.rows[25]!.scenarioId)!;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export function parseCatalogOverview(value: unknown): CatalogOverview {
|
|||||||
});
|
});
|
||||||
if (new Set(rows.map(row => row.scenarioId)).size !== 244 || new Set(rows.map(row => row.scenarioId.split(".")[0])).size !== 35) throw new Error("Duplicate or incomplete catalog metadata");
|
if (new Set(rows.map(row => row.scenarioId)).size !== 244 || new Set(rows.map(row => row.scenarioId.split(".")[0])).size !== 35) throw new Error("Duplicate or incomplete catalog metadata");
|
||||||
for (const row of rows) {
|
for (const row of rows) {
|
||||||
if ((row.mainOutcome !== "unmeasured") !== (row.executionRecord === "main-measured") || (row.allowance !== "unknown" && (row.allowance === "unused-initial") !== (row.executionRecord === "never-run"))
|
if ((row.mainOutcome !== "unmeasured") !== (row.executionRecord === "main-measured") || (row.allowance === "unused-initial") !== (row.executionRecord === "never-run")
|
||||||
|| (row.latestCandidateOutcome !== undefined && ["never-run", "unknown"].includes(row.executionRecord))) throw new Error("Inconsistent recorded execution scope");
|
|| (row.latestCandidateOutcome !== undefined && ["never-run", "unknown"].includes(row.executionRecord))) throw new Error("Inconsistent recorded execution scope");
|
||||||
}
|
}
|
||||||
const measured = rows.filter(row => row.mainOutcome !== "unmeasured").length;
|
const measured = rows.filter(row => row.mainOutcome !== "unmeasured").length;
|
||||||
|
|||||||
Reference in new issue
Block a user