Store the bare skip reason and own its format in present
This commit is contained in:
1 parent
b4090c22d7
commit
e623dae30c
5 files changed
+10
-10
No files matched your search
+5
-5
@@ -32,12 +32,12 @@ export interface TaskLabelFields {
|
||||
}
|
||||
|
||||
/**
|
||||
* One skipped format: the recorded reason with the supervisor's "Skipped
|
||||
* because " prefix removed, so every surface reads `(skipped: <reason>)`.
|
||||
* One skipped format: the row stores the bare reason, and this is the only
|
||||
* place that wraps it, so every surface reads `(skipped: <reason>)`.
|
||||
*/
|
||||
export function skippedText(errorMessage?: string): string {
|
||||
const reason = errorMessage?.replace(/^Skipped because /, "").trim();
|
||||
return reason ? `(skipped: ${reason})` : "(skipped)";
|
||||
export function skippedText(reason?: string): string {
|
||||
const text = reason?.trim();
|
||||
return text ? `(skipped: ${text})` : "(skipped)";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -431,7 +431,7 @@ export class WorkflowSupervisor {
|
||||
return {
|
||||
...taskBaseResult(task),
|
||||
status: "skipped",
|
||||
errorMessage: "Skipped because a required step did not succeed",
|
||||
errorMessage: "a required step did not succeed",
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ test("workflow formatting and persistence keep step ids and skipped steps", () =
|
||||
task: "audit {steps.scan.output}",
|
||||
status: "skipped",
|
||||
exitCode: null,
|
||||
errorMessage: "Skipped because a required step did not succeed",
|
||||
errorMessage: "a required step did not succeed",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@ import type { StartPlan, WorkflowStartResult } from "../src/workflow-run.ts";
|
||||
|
||||
test("skipped text is one format and keeps the reason", () => {
|
||||
assert.equal(
|
||||
skippedText("Skipped because a required step did not succeed"),
|
||||
skippedText("a required step did not succeed"),
|
||||
"(skipped: a required step did not succeed)",
|
||||
);
|
||||
assert.equal(skippedText(undefined), "(skipped)");
|
||||
@@ -36,7 +36,7 @@ test("one body rule answers for every task state", () => {
|
||||
"boom",
|
||||
);
|
||||
assert.equal(
|
||||
taskBody({ status: "skipped", errorMessage: "Skipped because a required step did not succeed" }),
|
||||
taskBody({ status: "skipped", errorMessage: "a required step did not succeed" }),
|
||||
"(skipped: a required step did not succeed)",
|
||||
);
|
||||
});
|
||||
|
||||
@@ -139,7 +139,7 @@ test("a failed step skips dependents transitively while independent branches fin
|
||||
],
|
||||
);
|
||||
assert.equal(terminal.results.every((result) => result.finishedAt !== undefined), true);
|
||||
assert.match(terminal.results[2].errorMessage ?? "", /Skipped/);
|
||||
assert.match(terminal.results[2].errorMessage ?? "", /required step did not succeed/);
|
||||
});
|
||||
|
||||
test("the per-run cap holds under fewer workers and the global FIFO releases the next step", async () => {
|
||||
|
||||
Reference in new issue
Block a user