diff --git a/scripts/test-projects.test-support.mjs b/scripts/test-projects.test-support.mjs index bca090b00ca..9bdee109dee 100644 --- a/scripts/test-projects.test-support.mjs +++ b/scripts/test-projects.test-support.mjs @@ -961,14 +961,35 @@ const TOOLING_SOURCE_TEST_TARGETS = new Map([ "scripts/openclaw-release-clawhub-runtime-state.ts", ["test/scripts/openclaw-release-clawhub-runtime-state.test.ts"], ], + [ + "scripts/openclaw-release-clawhub-plan.ts", + ["test/scripts/release-wrapper-scripts.test.ts"], + ], [ "scripts/plan-release-workflow-matrix.mjs", ["test/scripts/release-workflow-matrix-plan.test.ts"], ], + [ + "scripts/plugin-clawhub-release-check.ts", + ["test/scripts/release-wrapper-scripts.test.ts"], + ], + [ + "scripts/plugin-clawhub-release-plan.ts", + ["test/scripts/release-wrapper-scripts.test.ts"], + ], + [ + "scripts/plugin-npm-release-check.ts", + ["test/scripts/release-wrapper-scripts.test.ts"], + ], + [ + "scripts/plugin-npm-release-plan.ts", + ["test/scripts/release-wrapper-scripts.test.ts"], + ], [ "scripts/plugin-release-pretag-pack-check.ts", ["test/scripts/plugin-release-pretag-pack-check.test.ts"], ], + ["scripts/release-verify-beta.ts", ["test/scripts/release-wrapper-scripts.test.ts"]], [ "scripts/validate-release-publish-approval.mjs", ["test/scripts/validate-release-publish-approval.test.ts"], diff --git a/test/scripts/release-wrapper-scripts.test.ts b/test/scripts/release-wrapper-scripts.test.ts new file mode 100644 index 00000000000..0832ed32a75 --- /dev/null +++ b/test/scripts/release-wrapper-scripts.test.ts @@ -0,0 +1,52 @@ +// Release wrapper script tests keep changed-target routing tied to scripts that load the wrappers. +import { spawnSync } from "node:child_process"; +import { describe, expect, it } from "vitest"; + +const UNKNOWN_PACKAGE = "@openclaw/not-a-real-release-wrapper-test-package"; + +function runTsxScript(scriptPath: string, args: string[]) { + return spawnSync(process.execPath, ["--import", "tsx", scriptPath, ...args], { + cwd: process.cwd(), + encoding: "utf8", + }); +} + +describe("release wrapper scripts", () => { + it("runs plugin release wrapper CLIs and rejects unknown explicit selections", () => { + for (const scriptPath of [ + "scripts/plugin-npm-release-plan.ts", + "scripts/plugin-npm-release-check.ts", + "scripts/plugin-clawhub-release-plan.ts", + "scripts/plugin-clawhub-release-check.ts", + ]) { + const result = runTsxScript(scriptPath, ["--plugins", UNKNOWN_PACKAGE]); + + expect(result.status, scriptPath).toBe(1); + expect(result.stderr, scriptPath).toContain( + `Unknown or non-publishable plugin package selection: ${UNKNOWN_PACKAGE}.`, + ); + expect(result.stdout, scriptPath).toBe(""); + } + }); + + it("loads the OpenClaw ClawHub plan CLI and validates required arguments before planning", () => { + const result = runTsxScript("scripts/openclaw-release-clawhub-plan.ts", [ + "--release-tag", + "v2026.6.21-beta.1", + "--release-publish-run-id", + "123", + ]); + + expect(result.status).toBe(1); + expect(result.stderr).toContain("--release-publish-branch is required."); + expect(result.stdout).toBe(""); + }); + + it("loads the beta verifier CLI and validates required version input before remote checks", () => { + const result = runTsxScript("scripts/release-verify-beta.ts", ["--skip-clawhub"]); + + expect(result.status).toBe(1); + expect(result.stderr).toContain("Usage: pnpm release:verify-beta -- "); + expect(result.stdout).toBe(""); + }); +}); diff --git a/test/scripts/test-projects.test.ts b/test/scripts/test-projects.test.ts index 35032eaa527..564d5c08be8 100644 --- a/test/scripts/test-projects.test.ts +++ b/test/scripts/test-projects.test.ts @@ -1931,6 +1931,10 @@ describe("scripts/test-projects changed-target routing", () => { "scripts/openclaw-release-clawhub-runtime-state.ts", ["test/scripts/openclaw-release-clawhub-runtime-state.test.ts"], ], + [ + "scripts/openclaw-release-clawhub-plan.ts", + ["test/scripts/release-wrapper-scripts.test.ts"], + ], ["scripts/lib/openclaw-release-clawhub-plan.ts", ["test/plugin-clawhub-release.test.ts"]], [ "scripts/lib/plugin-clawhub-release.ts", @@ -1940,6 +1944,22 @@ describe("scripts/test-projects changed-target routing", () => { "scripts/lib/plugin-npm-release.ts", ["test/plugin-npm-release.test.ts", "test/plugin-clawhub-release.test.ts"], ], + [ + "scripts/plugin-clawhub-release-check.ts", + ["test/scripts/release-wrapper-scripts.test.ts"], + ], + [ + "scripts/plugin-clawhub-release-plan.ts", + ["test/scripts/release-wrapper-scripts.test.ts"], + ], + [ + "scripts/plugin-npm-release-check.ts", + ["test/scripts/release-wrapper-scripts.test.ts"], + ], + [ + "scripts/plugin-npm-release-plan.ts", + ["test/scripts/release-wrapper-scripts.test.ts"], + ], [ "scripts/plugin-release-pretag-pack-check.ts", ["test/scripts/plugin-release-pretag-pack-check.test.ts"], @@ -1948,6 +1968,7 @@ describe("scripts/test-projects changed-target routing", () => { "scripts/plan-release-workflow-matrix.mjs", ["test/scripts/release-workflow-matrix-plan.test.ts"], ], + ["scripts/release-verify-beta.ts", ["test/scripts/release-wrapper-scripts.test.ts"]], [ "scripts/validate-release-publish-approval.mjs", ["test/scripts/validate-release-publish-approval.test.ts"],