diff --git a/apps/dispatcher/src/admission-parent.test.ts b/apps/dispatcher/src/admission-parent.test.ts index d2f7791..a6d2e88 100644 --- a/apps/dispatcher/src/admission-parent.test.ts +++ b/apps/dispatcher/src/admission-parent.test.ts @@ -67,7 +67,7 @@ describe("leaveQueueForEndedParent", () => { { executionId: "part-a", parentExecutionId: "gate", parentStatus: "failure" }, { stepDo: (name, body) => Effect.promise(async () => { events.push(`step:${name}`); return body(); }), - store: { cancel: (ids) => Effect.sync(() => { events.push(`cancel:${ids.join(",")}`); }) }, + store: { cancel: (ids) => Effect.sync(() => { events.push(`cancel:${ids.join(",")}`); return { admittedSlots: 0 }; }) }, concludeCancelled: (summary) => Effect.sync(() => { events.push(`conclude:${summary}`); }), }, ), diff --git a/apps/dispatcher/src/dashboard.test.ts b/apps/dispatcher/src/dashboard.test.ts index 72f2ff1..d797350 100644 --- a/apps/dispatcher/src/dashboard.test.ts +++ b/apps/dispatcher/src/dashboard.test.ts @@ -27,6 +27,7 @@ const baseRow = (over: Partial = {}): DashboardRow => ({ logsUrl: null, demosUrl: null, selfHealPrUrl: null, + supersededBy: null, ...over, }); @@ -114,6 +115,24 @@ describe("renderDashboard", () => { expect(html).not.toContain("badge selfheal"); }); + it("labels a cancelled execution with the execution that superseded it", () => { + const html = renderDashboard(data([baseRow({ status: "cancelled", supersededBy: "gate-newer" })])); + expect(html).toContain('superseded by gate-newer'); + }); + + it("labels a cancelled execution a pull-request close superseded", () => { + const html = renderDashboard( + data([baseRow({ status: "cancelled", supersededBy: "pr-closed:1000:contextful-gate:o/r#7" })]), + ); + expect(html).toContain("pull request closed"); + expect(html).not.toContain("superseded by"); + }); + + it("labels no execution that is not cancelled", () => { + const html = renderDashboard(data([baseRow({ status: "running", supersededBy: "gate-newer" })])); + expect(html).not.toContain("superseded by"); + }); + it("escapes HTML in execution fields", () => { const html = renderDashboard(data([baseRow({ repo: "