mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-17 18:31:39 +00:00
* fix(release): bind validation evidence to exact attempts * test(release): cover exact validation attempts
54 lines
1.7 KiB
TypeScript
54 lines
1.7 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { parseArgs } from "../../scripts/full-release-validation-at-sha.mjs";
|
|
|
|
describe("full-release-validation-at-sha", () => {
|
|
it("parses release validation dispatch args", () => {
|
|
expect(
|
|
parseArgs([
|
|
"--sha",
|
|
"abc123",
|
|
"--workflow-sha",
|
|
"origin/main",
|
|
"--keep-branch",
|
|
"--dry-run",
|
|
"-f",
|
|
"provider=anthropic",
|
|
"--",
|
|
"mode=linux",
|
|
]),
|
|
).toMatchObject({
|
|
dryRun: true,
|
|
keepBranch: true,
|
|
inputs: {
|
|
mode: "linux",
|
|
provider: "anthropic",
|
|
reuse_evidence: "false",
|
|
},
|
|
sha: "abc123",
|
|
workflowSha: "origin/main",
|
|
});
|
|
});
|
|
|
|
it("rejects missing option values", () => {
|
|
expect(() => parseArgs(["--sha", "--dry-run"])).toThrow("--sha requires a value");
|
|
expect(() => parseArgs(["--sha", "-h"])).toThrow("--sha requires a value");
|
|
expect(() => parseArgs(["--workflow-sha", "--dry-run"])).toThrow(
|
|
"--workflow-sha requires a value",
|
|
);
|
|
expect(() => parseArgs(["--workflow-sha", "-h"])).toThrow("--workflow-sha requires a value");
|
|
expect(() => parseArgs(["-f", "--dry-run"])).toThrow("-f requires a value");
|
|
expect(() => parseArgs(["-f", "-h"])).toThrow("-f requires a value");
|
|
});
|
|
|
|
it("cannot enable evidence reuse on a temporary SHA-pinned workflow ref", () => {
|
|
expect(() => parseArgs(["-f", "reuse_evidence=true"])).toThrow(
|
|
"always disables evidence reuse",
|
|
);
|
|
});
|
|
|
|
it("reserves the candidate ref for the resolved --sha", () => {
|
|
expect(() => parseArgs(["-f", "ref=other"])).toThrow("reserves the ref input");
|
|
expect(() => parseArgs(["--", "ref=other"])).toThrow("reserves the ref input");
|
|
});
|
|
});
|