mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:10:49 +00:00
ci: preserve artifact package source metadata
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import { mkdtemp, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
parseArgs,
|
||||
readArtifactPackageCandidateMetadata,
|
||||
validateOpenClawPackageSpec,
|
||||
} from "../../scripts/resolve-openclaw-package-candidate.mjs";
|
||||
|
||||
@@ -57,4 +61,28 @@ describe("resolve-openclaw-package-candidate", () => {
|
||||
source: "npm",
|
||||
});
|
||||
});
|
||||
|
||||
it("reads package source metadata from package artifacts", async () => {
|
||||
const dir = await mkdtemp(path.join(tmpdir(), "openclaw-package-candidate-"));
|
||||
await writeFile(
|
||||
path.join(dir, "package-candidate.json"),
|
||||
JSON.stringify(
|
||||
{
|
||||
packageRef: "release/2026.4.30",
|
||||
packageSourceSha: "66ce632b9b7c5c7fdd3e66c739687d51638ad6e2",
|
||||
packageTrustedReason: "repository-branch-history",
|
||||
sha256: "a".repeat(64),
|
||||
},
|
||||
null,
|
||||
2,
|
||||
),
|
||||
);
|
||||
|
||||
await expect(readArtifactPackageCandidateMetadata(dir)).resolves.toMatchObject({
|
||||
packageRef: "release/2026.4.30",
|
||||
packageSourceSha: "66ce632b9b7c5c7fdd3e66c739687d51638ad6e2",
|
||||
packageTrustedReason: "repository-branch-history",
|
||||
sha256: "a".repeat(64),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user