mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-28 08:42:14 +00:00
test(plugins): fail gauntlet on load diagnostics
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
collectGatewayCpuObservations,
|
||||
collectMetricObservations,
|
||||
collectQaBaselineRegressionObservations,
|
||||
detectCommandDiagnosticFailure,
|
||||
discoverBundledPluginManifests,
|
||||
schemaHasRequiredFields,
|
||||
selectPluginEntries,
|
||||
@@ -84,6 +85,7 @@ describe("plugin gateway gauntlet helpers", () => {
|
||||
});
|
||||
|
||||
it("skips source-only plugin dirs that are excluded from the built runtime", async () => {
|
||||
await writeManifest("qa-lab", "openclaw.plugin.json", JSON.stringify({ id: "qa-lab" }));
|
||||
await writeManifest("qqbot", "openclaw.plugin.json", JSON.stringify({ id: "qqbot" }));
|
||||
await writeManifest("telegram", "openclaw.plugin.json", JSON.stringify({ id: "telegram" }));
|
||||
|
||||
@@ -92,6 +94,22 @@ describe("plugin gateway gauntlet helpers", () => {
|
||||
expect(matrix.map((entry) => entry.id)).toEqual(["telegram"]);
|
||||
});
|
||||
|
||||
it("detects plugin load failures in successful command output", () => {
|
||||
expect(
|
||||
detectCommandDiagnosticFailure(
|
||||
"Installed plugin: qa-lab\n",
|
||||
"[plugins] qa-lab failed to load from /repo/extensions/qa-lab/index.ts: Error: nope\n",
|
||||
),
|
||||
).toBe("plugin-load-failure");
|
||||
expect(
|
||||
detectCommandDiagnosticFailure(
|
||||
"",
|
||||
"\u001B[36m[plugins]\u001B[39m qa-lab failed to load from /repo/extensions/qa-lab/index.ts: Error: nope\n",
|
||||
),
|
||||
).toBe("plugin-load-failure");
|
||||
expect(detectCommandDiagnosticFailure("Installed plugin: qa-lab\n", "")).toBeNull();
|
||||
});
|
||||
|
||||
it("selects plugin shards after explicit id filtering", () => {
|
||||
const entries = ["a", "b", "c", "d"].map((id) => ({ id }));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user