mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-07 18:42:25 +00:00
test(release): align kitchen sink rpc descriptors
This commit is contained in:
@@ -1366,13 +1366,17 @@ export function assertCreatedKitchenSinkSession(payload, expectedKey = SESSION_K
|
||||
return created;
|
||||
}
|
||||
|
||||
export function assertKitchenSinkUiDescriptors(payload) {
|
||||
export function assertKitchenSinkUiDescriptors(payload, options = {}) {
|
||||
const expectDescriptor = options.expectDescriptor !== false;
|
||||
const descriptorPayload = assertObjectPayload(payload, "plugins.uiDescriptors");
|
||||
if (descriptorPayload.ok !== true || !Array.isArray(descriptorPayload.descriptors)) {
|
||||
throw new Error(
|
||||
`plugins.uiDescriptors returned invalid payload: ${boundedJsonPreview(payload)}`,
|
||||
);
|
||||
}
|
||||
if (!expectDescriptor) {
|
||||
return undefined;
|
||||
}
|
||||
const descriptor = descriptorPayload.descriptors.find((entry) => entry?.pluginId === PLUGIN_ID);
|
||||
if (!descriptor) {
|
||||
throw new Error(
|
||||
@@ -2171,7 +2175,9 @@ export async function main() {
|
||||
assertTtsProviderCoverage(ttsStatus, "status");
|
||||
|
||||
const uiDescriptors = await retryRpcCall("plugins.uiDescriptors", {}, rpcOptions);
|
||||
assertKitchenSinkUiDescriptors(uiDescriptors);
|
||||
assertKitchenSinkUiDescriptors(uiDescriptors, {
|
||||
expectDescriptor: env.OPENCLAW_KITCHEN_SINK_PERSONALITY !== "conformance",
|
||||
});
|
||||
const stability = await retryRpcCall("diagnostics.stability", {}, rpcOptions);
|
||||
assertDiagnosticStabilityClean(stability);
|
||||
await sampleInFlight?.catch(() => {});
|
||||
|
||||
@@ -1033,6 +1033,22 @@ describe("kitchen-sink RPC command catalog assertions", () => {
|
||||
"plugins.uiDescriptors did not report Kitchen Sink descriptor",
|
||||
);
|
||||
});
|
||||
|
||||
it("allows conformance mode to skip generated Kitchen Sink UI descriptors", () => {
|
||||
expect(() =>
|
||||
assertKitchenSinkUiDescriptors(
|
||||
{
|
||||
ok: true,
|
||||
descriptors: [],
|
||||
},
|
||||
{ expectDescriptor: false },
|
||||
),
|
||||
).not.toThrow();
|
||||
|
||||
expect(() => assertKitchenSinkUiDescriptors({}, { expectDescriptor: false })).toThrow(
|
||||
"plugins.uiDescriptors returned invalid payload",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("kitchen-sink RPC diagnostics assertions", () => {
|
||||
|
||||
Reference in New Issue
Block a user