fix(ci): harden cross-os release harness

This commit is contained in:
Peter Steinberger
2026-04-28 22:12:27 +01:00
parent 7b2b0d07e8
commit 25f7e062e1
3 changed files with 121 additions and 2 deletions

View File

@@ -55,6 +55,7 @@ import {
shouldUseManagedGatewayForInstallerRuntime,
shouldUseManagedGatewayService,
verifyDevUpdateStatus,
verifyPackagedUpgradeUpdateResult,
writePackageDistInventoryForCandidate,
} from "../../scripts/openclaw-cross-os-release-checks.ts";
@@ -508,6 +509,60 @@ describe("scripts/openclaw-cross-os-release-checks", () => {
});
});
it("accepts a successful packaged update followed by the old self-swapped process import miss", () => {
expect(() =>
verifyPackagedUpgradeUpdateResult(
{
exitCode: 1,
stdout: JSON.stringify({
status: "ok",
after: { version: "2026.4.27" },
steps: [{ name: "global update", exitCode: 0 }],
}),
stderr:
"[openclaw] Failed to start CLI: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/tmp/prefix/lib/node_modules/openclaw/dist/memory-state-old.js'",
},
{ candidateVersion: "2026.4.27" },
),
).not.toThrow();
});
it("rejects packaged update failures before the candidate package lands", () => {
expect(() =>
verifyPackagedUpgradeUpdateResult(
{
exitCode: 1,
stdout: JSON.stringify({
status: "ok",
after: { version: "2026.4.26" },
steps: [{ name: "global update", exitCode: 0 }],
}),
stderr:
"[openclaw] Failed to start CLI: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/tmp/prefix/lib/node_modules/openclaw/dist/memory-state-old.js'",
},
{ candidateVersion: "2026.4.27" },
),
).toThrow(/Packaged upgrade failed/u);
});
it("rejects packaged update failures with unsuccessful update steps", () => {
expect(() =>
verifyPackagedUpgradeUpdateResult(
{
exitCode: 1,
stdout: JSON.stringify({
status: "ok",
after: { version: "2026.4.27" },
steps: [{ name: "global update", exitCode: 1 }],
}),
stderr:
"[openclaw] Failed to start CLI: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/tmp/prefix/lib/node_modules/openclaw/dist/memory-state-old.js'",
},
{ candidateVersion: "2026.4.27" },
),
).toThrow(/Packaged upgrade failed/u);
});
it("only treats pinned baseline specs as exact installer version assertions", () => {
expect(resolveExplicitBaselineVersion("")).toBe("");
expect(resolveExplicitBaselineVersion("openclaw@latest")).toBe("");