mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:10:51 +00:00
fix(ci): harden cross-os release harness
This commit is contained in:
@@ -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("");
|
||||
|
||||
Reference in New Issue
Block a user