mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:20:44 +00:00
fix(build): stamp runtime postbuild artifacts
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
hasGatewayReadyLog,
|
||||
isIgnoredDistRuntimeWatchPath,
|
||||
shouldRefreshBuildStampForRestoredArtifacts,
|
||||
writeBuildAndRuntimePostBuildStamps,
|
||||
} from "../../scripts/check-gateway-watch-regression.mjs";
|
||||
import {
|
||||
BUILD_STAMP_FILE,
|
||||
RUNTIME_POSTBUILD_STAMP_FILE,
|
||||
} from "../../scripts/lib/local-build-metadata-paths.mjs";
|
||||
|
||||
describe("check-gateway-watch-regression", () => {
|
||||
it("ignores top-level dist-runtime extension dependency repairs", () => {
|
||||
@@ -50,4 +58,22 @@ describe("check-gateway-watch-regression", () => {
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("refreshes runtime postbuild stamps after build stamps", () => {
|
||||
const rootDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-gateway-watch-stamps-"));
|
||||
try {
|
||||
fs.mkdirSync(path.join(rootDir, ".git"), { recursive: true });
|
||||
writeBuildAndRuntimePostBuildStamps({ cwd: rootDir });
|
||||
|
||||
const buildStampPath = path.join(rootDir, "dist", BUILD_STAMP_FILE);
|
||||
const runtimeStampPath = path.join(rootDir, "dist", RUNTIME_POSTBUILD_STAMP_FILE);
|
||||
expect(fs.existsSync(buildStampPath)).toBe(true);
|
||||
expect(fs.existsSync(runtimeStampPath)).toBe(true);
|
||||
expect(fs.statSync(runtimeStampPath).mtimeMs).toBeGreaterThanOrEqual(
|
||||
fs.statSync(buildStampPath).mtimeMs,
|
||||
);
|
||||
} finally {
|
||||
fs.rmSync(rootDir, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user