mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 02:26:12 +02:00
Preserve behavior failures when regenerating E2E dashboards
Keep clean evidence distinct from a passing execution. Add a regression covering a failed result with evidenceValid=true. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
1c5b9c8b14
commit
b330ec27e2
2 files changed
+15
-2
No files matched your search
@@ -131,8 +131,8 @@ export async function regenerateRunnerDashboard(input: {
|
||||
return {
|
||||
result,
|
||||
valid:
|
||||
publishedResult.evidenceValid ??
|
||||
(result.status === "passed" && result.cleanup === "passed"),
|
||||
result.status === "passed" && result.cleanup === "passed" &&
|
||||
publishedResult.evidenceValid !== false,
|
||||
errors: publishedResult.evidenceErrors ?? [],
|
||||
evidenceBaseHref,
|
||||
evidenceFiles,
|
||||
|
||||
@@ -101,6 +101,19 @@ describe("runner E2E campaign history", () => {
|
||||
expect(dashboard).not.toContain("NaN");
|
||||
});
|
||||
|
||||
it("does not turn a clean-evidence behavior failure into a pass when regenerating", async () => {
|
||||
const root = await mkdtemp(path.join(os.tmpdir(), "runner-failed-evidence-"));
|
||||
temporaryDirectories.push(root);
|
||||
const execution = runnerMatrix[0];
|
||||
const failedResult = { ...result(execution, "failed"), failureClass: "candidate_failure" as const, error: "Behavior check failed", evidenceValid: true, evidenceErrors: [] };
|
||||
const campaign = buildRunnerCampaign({ campaignId: "failed", generatedAt: failedResult.finishedAt, expected: [execution.id], results: [failedResult] });
|
||||
await writeFile(path.join(root, "normalized-results.json"), JSON.stringify({ ...campaign, results: [failedResult] }));
|
||||
await regenerateRunnerDashboard({ bundle: root });
|
||||
const page = await readFile(path.join(root, "index.html"), "utf8");
|
||||
expect(page).toContain('class="case case-failed"');
|
||||
expect(page).not.toContain('class="case case-passed"');
|
||||
});
|
||||
|
||||
it("records the resolved paid target instead of the trusted workflow checkout", () => {
|
||||
vi.stubEnv("PAPERCLIP_RUNNER_E2E_SOURCE_SHA", "target-sha");
|
||||
vi.stubEnv("PAPERCLIP_RUNNER_E2E_SOURCE_REF", "refs/heads/target");
|
||||
|
||||
Reference in new issue
Block a user