fix: propagate failed hwpod operation result

This commit is contained in:
root
2026-07-21 03:50:17 +02:00
parent 2c71f07727
commit 2aeaec4082
2 changed files with 23 additions and 2 deletions
+19
View File
@@ -196,6 +196,25 @@ test("HWPOD operation status requires explicit over-api mode", async () => {
assert.equal(result.payload.error.code, "hwpod_operation_status_over_api_required");
});
test("HWPOD operation status fails when the Temporal result failed", async () => {
const operationId = "hwpod_failed_001";
const fetchImpl = async () => Response.json({
ok: true,
operationId,
status: "completed",
result: { ok: false, status: "failed", response: { error: { code: "node_unavailable" } } }
});
const result = await runHwpodCli([
"operation", "status", operationId, "--over-api", "--api-base-url", "http://hwpod.test"
], { fetchImpl: fetchImpl as typeof fetch });
assert.equal(result.exitCode, 1);
assert.equal(result.payload.ok, false);
assert.equal(result.payload.status, "failed");
assert.equal(result.payload.body.result.response.error.code, "node_unavailable");
});
test("HWPOD over-api resolves a registry spec from the API envelope", async () => {
let submitted: any = null;
const fetchImpl = async (input: string | URL | Request, init?: RequestInit) => {