mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-07 07:58:36 +00:00
fix(ci): harden full release live checks
This commit is contained in:
@@ -94,6 +94,39 @@ describe("check-openclaw-package-tarball", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects dist files that import missing relative chunks", () => {
|
||||
withTarball(
|
||||
["dist/cli/run-main.js"],
|
||||
{ "dist/cli/run-main.js": 'await import("../memory-state-old.js");\n' },
|
||||
(tarball) => {
|
||||
const result = spawnSync("node", [CHECK_SCRIPT, tarball], { encoding: "utf8" });
|
||||
|
||||
expect(result.status).not.toBe(0);
|
||||
expect(result.stderr).toContain(
|
||||
"dist/cli/run-main.js imports missing dist/memory-state-old.js",
|
||||
);
|
||||
},
|
||||
"2026.4.27",
|
||||
);
|
||||
});
|
||||
|
||||
it("accepts dist files whose relative chunks are present", () => {
|
||||
withTarball(
|
||||
["dist/cli/run-main.js", "dist/memory-state-current.js"],
|
||||
{
|
||||
"dist/cli/run-main.js": 'await import("../memory-state-current.js");\n',
|
||||
"dist/memory-state-current.js": "export {};\n",
|
||||
},
|
||||
(tarball) => {
|
||||
const result = spawnSync("node", [CHECK_SCRIPT, tarball], { encoding: "utf8" });
|
||||
|
||||
expect(result.status, result.stderr).toBe(0);
|
||||
expect(result.stdout).toContain("OpenClaw package tarball integrity passed.");
|
||||
},
|
||||
"2026.4.27",
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects missing Control UI assets", () => {
|
||||
withTarball(
|
||||
["dist/index.js"],
|
||||
|
||||
@@ -53,11 +53,18 @@ describe("test-install-sh-docker", () => {
|
||||
|
||||
it("can reuse dist from the already-built root Docker smoke image", () => {
|
||||
const script = readFileSync(SCRIPT_PATH, "utf8");
|
||||
const dockerfile = readFileSync("Dockerfile", "utf8");
|
||||
|
||||
expect(script).toContain('UPDATE_DIST_IMAGE="${OPENCLAW_INSTALL_SMOKE_UPDATE_DIST_IMAGE:-}"');
|
||||
expect(script).toContain("restore_local_dist_from_image");
|
||||
expect(script).toContain('docker cp "${container_id}:/app/dist" "$ROOT_DIR/dist"');
|
||||
expect(script).toContain('echo "==> Reuse local dist/ from Docker image: $image"');
|
||||
expect(script).toContain("ensure_local_update_dist_import_closure");
|
||||
expect(script).toContain('node scripts/check-package-dist-imports.mjs "$ROOT_DIR"');
|
||||
expect(script).toContain("WARN: reused Docker image dist failed import-closure check");
|
||||
expect(script).toContain("pnpm build");
|
||||
expect(script).toContain("pnpm ui:build");
|
||||
expect(dockerfile).toContain("node scripts/check-package-dist-imports.mjs /app");
|
||||
});
|
||||
|
||||
it("allows repository branch history and release tags for secret-backed Docker release checks", () => {
|
||||
@@ -92,7 +99,9 @@ describe("test-install-sh-docker", () => {
|
||||
const script = readFileSync(SCRIPT_PATH, "utf8");
|
||||
|
||||
expect(script).toContain("node --import tsx scripts/write-package-dist-inventory.ts");
|
||||
expect(script).toContain('node scripts/check-package-dist-imports.mjs "$ROOT_DIR"');
|
||||
expect(script).toContain("quiet_npm pack --ignore-scripts");
|
||||
expect(script).toContain("node scripts/check-openclaw-package-tarball.mjs");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user