fix(e2e): fail bundled smoke on missing channels · openclaw/openclaw@5957bfd
vincentkoc
·
2026-06-01
·
via Recent Commits to openclaw:main
File tree
scripts/e2e/lib/bundled-plugin-install-uninstall
| Original file line number | Diff line number | Diff line change |
|---|
@@ -705,11 +705,7 @@ async function runManifestProbes(plan, options) {
|
705 | 705 | { probe: false, timeoutMs: 2000 }, |
706 | 706 | options, |
707 | 707 | ); |
708 | | -if (!isChannelVisible(status, channel)) { |
709 | | -console.log( |
710 | | -`Runtime channel status smoke skipped for ${options.pluginId}: ${channel} is not visible in dry channels.status`, |
711 | | -); |
712 | | -} |
| 708 | +assertChannelVisible(status, channel, options.pluginId); |
713 | 709 | } |
714 | 710 | if (plan.runtimeSlashAliases.length > 0 && plan.activeInThisProbe) { |
715 | 711 | await retryCommandsListWithAliases(plan.runtimeSlashAliases, options); |
@@ -748,6 +744,15 @@ function isChannelVisible(payload, channel) {
|
748 | 744 | return false; |
749 | 745 | } |
750 | 746 | |
| 747 | +export function assertChannelVisible(payload, channel, pluginId) { |
| 748 | +if (isChannelVisible(payload, channel)) { |
| 749 | +return; |
| 750 | +} |
| 751 | +throw new Error( |
| 752 | +`Runtime channel status missing manifest channel ${channel} for ${pluginId}: channels.status did not expose the declared channel`, |
| 753 | +); |
| 754 | +} |
| 755 | + |
751 | 756 | export function isCommandVisible(payload, alias) { |
752 | 757 | const expected = alias.replace(/^\//u, "").toLowerCase(); |
753 | 758 | const commands = Array.isArray(payload.commands) ? payload.commands : []; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -188,6 +188,23 @@ describe("bundled plugin install/uninstall probe", () => {
|
188 | 188 | expect(runtimeSmoke.isCommandVisible(payload, "/missing")).toBe(false); |
189 | 189 | }); |
190 | 190 | |
| 191 | +it("fails runtime smoke when declared channels are absent from status", async () => { |
| 192 | +const runtimeSmoke = await import(pathToFileURL(runtimeSmokePath).href); |
| 193 | + |
| 194 | +expect(() => |
| 195 | +runtimeSmoke.assertChannelVisible( |
| 196 | +{ channelMeta: [{ id: "qa-channel" }] }, |
| 197 | +"qa-channel", |
| 198 | +"qa-channel", |
| 199 | +), |
| 200 | +).not.toThrow(); |
| 201 | +expect(() => |
| 202 | +runtimeSmoke.assertChannelVisible({}, "qa-channel", "qa-channel"), |
| 203 | +).toThrow( |
| 204 | +"Runtime channel status missing manifest channel qa-channel for qa-channel", |
| 205 | +); |
| 206 | +}); |
| 207 | + |
191 | 208 | it("rejects loose runtime output limit env values instead of parsing prefixes", async () => { |
192 | 209 | const runtimeSmoke = await importRuntimeSmokeWithEnv({ |
193 | 210 | OPENCLAW_BUNDLED_PLUGIN_RUNTIME_OUTPUT_CHARS: "5chars", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。