diff --git a/scripts/e2e/lib/kitchen-sink-plugin/assertions.mjs b/scripts/e2e/lib/kitchen-sink-plugin/assertions.mjs index a4d1277d8c6..858f284b69a 100644 --- a/scripts/e2e/lib/kitchen-sink-plugin/assertions.mjs +++ b/scripts/e2e/lib/kitchen-sink-plugin/assertions.mjs @@ -110,6 +110,7 @@ function configureRuntime() { ...config.channels, "kitchen-sink-channel": { enabled: true, token: "kitchen-sink-ci" }, }; + fs.mkdirSync(path.dirname(configPath), { recursive: true }); fs.writeFileSync(configPath, `${JSON.stringify(config, null, 2)}\n`); } @@ -133,6 +134,8 @@ const expectMissing = (listValue, expected, field) => { } }; +const INVALID_PROBE_DIAGNOSTIC_SURFACE_MODES = new Set(["full", "adversarial"]); + function assertExpectedDiagnostics(surfaceMode, errorMessages) { const expectedErrorMessages = new Set([ "only bundled plugins can register agent tool result middleware", @@ -146,7 +149,7 @@ function assertExpectedDiagnostics(surfaceMode, errorMessages) { "plugin must own memory slot or declare contracts.memoryEmbeddingProviders for adapter: kitchen-sink-memory-embedding-provider", "memory prompt supplement registration missing builder", ]); - if (surfaceMode !== "full" && surfaceMode !== "conformance" && surfaceMode !== "adversarial") { + if (!INVALID_PROBE_DIAGNOSTIC_SURFACE_MODES.has(surfaceMode)) { if (errorMessages.size > 0) { throw new Error( `unexpected kitchen-sink diagnostic errors: ${[...errorMessages].join(", ")}`, diff --git a/scripts/e2e/lib/kitchen-sink-plugin/sweep.sh b/scripts/e2e/lib/kitchen-sink-plugin/sweep.sh index b48315448a2..c877753a123 100644 --- a/scripts/e2e/lib/kitchen-sink-plugin/sweep.sh +++ b/scripts/e2e/lib/kitchen-sink-plugin/sweep.sh @@ -75,8 +75,8 @@ assert_kitchen_sink_removed() { run_success_scenario() { echo "Testing ${KITCHEN_SINK_LABEL} install from ${KITCHEN_SINK_SPEC}..." - run_logged_print "kitchen-sink-install-${KITCHEN_SINK_LABEL}" node "$OPENCLAW_ENTRY" plugins install "$KITCHEN_SINK_SPEC" configure_kitchen_sink_runtime + run_logged_print "kitchen-sink-install-${KITCHEN_SINK_LABEL}" node "$OPENCLAW_ENTRY" plugins install "$KITCHEN_SINK_SPEC" run_logged_print "kitchen-sink-enable-${KITCHEN_SINK_LABEL}" node "$OPENCLAW_ENTRY" plugins enable "$KITCHEN_SINK_ID" node "$OPENCLAW_ENTRY" plugins list --json >"/tmp/kitchen-sink-${KITCHEN_SINK_LABEL}-plugins.json" node "$OPENCLAW_ENTRY" plugins inspect "$KITCHEN_SINK_ID" --json >"/tmp/kitchen-sink-${KITCHEN_SINK_LABEL}-inspect.json" diff --git a/test/scripts/plugin-prerelease-test-plan.test.ts b/test/scripts/plugin-prerelease-test-plan.test.ts index a40dc5b3602..611831bd154 100644 --- a/test/scripts/plugin-prerelease-test-plan.test.ts +++ b/test/scripts/plugin-prerelease-test-plan.test.ts @@ -113,10 +113,10 @@ describe("scripts/lib/plugin-prerelease-test-plan.mjs", () => { sweepScript.indexOf("run_success_scenario()"), sweepScript.indexOf("run_failure_scenario()"), ); - expect(successScenario.indexOf('plugins install "$KITCHEN_SINK_SPEC"')).toBeLessThan( - successScenario.indexOf("configure_kitchen_sink_runtime"), - ); expect(successScenario.indexOf("configure_kitchen_sink_runtime")).toBeLessThan( + successScenario.indexOf('plugins install "$KITCHEN_SINK_SPEC"'), + ); + expect(successScenario.indexOf('plugins install "$KITCHEN_SINK_SPEC"')).toBeLessThan( successScenario.indexOf('plugins enable "$KITCHEN_SINK_ID"'), ); expect(sweepScript).toContain("run_failure_scenario"); @@ -124,6 +124,13 @@ describe("scripts/lib/plugin-prerelease-test-plan.mjs", () => { expect(assertionsScript).toContain("record.clawhubPackage !== packageName"); expect(assertionsScript).toContain("assertClawHubExternalInstallContract"); expect(assertionsScript).toContain("expectedErrorMessages"); + expect(assertionsScript).toContain( + 'const INVALID_PROBE_DIAGNOSTIC_SURFACE_MODES = new Set(["full", "adversarial"]);', + ); + expect(assertionsScript).toContain("!INVALID_PROBE_DIAGNOSTIC_SURFACE_MODES.has(surfaceMode)"); + expect(assertionsScript).not.toContain( + 'const INVALID_PROBE_DIAGNOSTIC_SURFACE_MODES = new Set(["full", "conformance"', + ); expect(readFileSync("scripts/e2e/lib/clawhub-fixture-server.cjs", "utf8")).toContain( 'from "openclaw/plugin-sdk/plugin-entry"', );