Files
openclaw/test/scripts/testbox-lease-freshness.test.ts
Vincent Koc c47ceb0f3d improve(release): reuse exact-SHA validation evidence (#104162)
* perf(release): share changelog verification snapshots

* perf(release): reuse exact-SHA validation evidence

* feat(release): checkpoint candidate workflow state

* feat(release): watch CI transitions compactly

* fix(testbox): rotate stale reusable leases

* refactor(release): move CI verifier into scripts

* fix(release): preserve verifier executable mode

* fix(testbox): force noninteractive remote hydration

* perf(testbox): skip sync for proven clean heads

* fix(testbox): keep changed gates synchronized

* fix(testbox): isolate git state probes

* fix(testbox): isolate wrapper git commands

* fix(testbox): preserve git command contracts

* fix(release): validate reused SHA evidence

* fix(release): resume serialized plugin selections

* fix(testbox): sync source on every lease reuse

* fix(release): verify from trusted workflow checkout

* fix(release): gate evidence reuse on trusted lineage

* fix(release): support legacy verifier checkouts

* fix(testbox): export CI across shell snippets

* fix(release): revalidate reused evidence before publish

* fix(release): reject untrusted reuse before lookup

* fix(release): reuse SHA-pinned root evidence

* fix(ci): allow unreleased notes in QA packages

* fix(release): satisfy script lint contracts

* fix(release): handle Unicode workflow refs safely
2026-07-11 12:48:27 +08:00

38 lines
1.1 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { testboxLeaseStaleReasons } from "../../scripts/testbox-lease-freshness.mjs";
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",
]);
});
});