fix: propagate failed hwpod operation result
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user