feat: add omx team adapter skeleton
This commit is contained in:
53
tests/orchestration-backend-selector.test.ts
Normal file
53
tests/orchestration-backend-selector.test.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import {
|
||||
listOrchestrationBackendChoices,
|
||||
selectOrchestrationBackendForTesting,
|
||||
} from "@/lib/execution/orchestration-backend-selector";
|
||||
|
||||
test("listOrchestrationBackendChoices keeps omx disabled by default", async () => {
|
||||
const backends = await listOrchestrationBackendChoices();
|
||||
|
||||
assert.deepEqual(
|
||||
backends.map((backend) => backend.backendId),
|
||||
["boss-native-orchestrator"],
|
||||
);
|
||||
});
|
||||
|
||||
test("selectOrchestrationBackendForTesting honors explicit omx request when selectable", async () => {
|
||||
const backend = await selectOrchestrationBackendForTesting({
|
||||
requestedBackendId: "omx-team",
|
||||
omx: {
|
||||
enabled: true,
|
||||
selectable: true,
|
||||
availability: {
|
||||
status: "ready",
|
||||
selectable: true,
|
||||
configured: true,
|
||||
reason: "ready",
|
||||
reasonLabel: "OMX Team Runtime 可用。",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
assert.equal(backend.backendId, "omx-team");
|
||||
});
|
||||
|
||||
test("selectOrchestrationBackendForTesting falls back when omx is requested but unavailable", async () => {
|
||||
const backend = await selectOrchestrationBackendForTesting({
|
||||
requestedBackendId: "omx-team",
|
||||
omx: {
|
||||
enabled: false,
|
||||
selectable: false,
|
||||
availability: {
|
||||
status: "disabled",
|
||||
selectable: false,
|
||||
configured: false,
|
||||
reason: "disabled",
|
||||
reasonLabel: "OMX Team Runtime 当前未启用。",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
assert.equal(backend.backendId, "boss-native-orchestrator");
|
||||
});
|
||||
Reference in New Issue
Block a user