mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
c70aee247e
* refactor(scripts): migrate JavaScript tools to TypeScript * fix(ci): keep changed-scope preflight zero-install * fix(ci): preserve zero-install script owners * fix(ci): complete script migration follow-through * fix(release): keep stable closeout zero-install * fix(scripts): preserve standalone execution boundaries * fix(scripts): repair standalone loader boundaries * fix(scripts): normalize gateway observation ids * fix(scripts): keep Docker packager standalone * test(scripts): preserve rebase cleanup helpers * test(sessions): use tracked temp directory
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { testboxLeaseStaleReasons } from "../../scripts/testbox-lease-freshness.mts";
|
|
|
|
const fingerprint = {
|
|
version: 1,
|
|
baseSha: "a".repeat(40),
|
|
headSha: "d".repeat(40),
|
|
workingTreeClean: true,
|
|
dependencyDigest: "b".repeat(64),
|
|
environmentDigest: "c".repeat(64),
|
|
workflow: ".github/workflows/ci-check-testbox.yml",
|
|
job: "check",
|
|
ref: "main",
|
|
};
|
|
|
|
describe("Testbox lease freshness", () => {
|
|
it("reuses a lease when hydrated inputs still match", () => {
|
|
expect(testboxLeaseStaleReasons(fingerprint, { ...fingerprint })).toEqual([]);
|
|
});
|
|
|
|
it("rotates a lease when base, dependency, or workflow inputs drift", () => {
|
|
expect(
|
|
testboxLeaseStaleReasons(fingerprint, {
|
|
...fingerprint,
|
|
baseSha: "d".repeat(40),
|
|
dependencyDigest: "e".repeat(64),
|
|
workflow: "other.yml",
|
|
}),
|
|
).toEqual(["baseSha", "dependencyDigest", "workflow"]);
|
|
});
|
|
|
|
it("rejects unknown provenance schemas", () => {
|
|
expect(testboxLeaseStaleReasons({ ...fingerprint, version: 2 }, fingerprint)).toEqual([
|
|
"state schema",
|
|
]);
|
|
});
|
|
});
|