fix(release): reject malformed beta smoke limits · openclaw/openclaw@3d4d30f
vincentkoc
·
2026-06-03
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,6 +4,7 @@ import {
|
4 | 4 | parseArgs, |
5 | 5 | parseWorkflowRunIdFromOutput, |
6 | 6 | pollRun, |
| 7 | +readPositiveInt, |
7 | 8 | run, |
8 | 9 | selectNewestDispatchedRunId, |
9 | 10 | } from "../../scripts/release-beta-smoke.ts"; |
@@ -32,6 +33,18 @@ describe("release-beta-smoke", () => {
|
32 | 33 | }); |
33 | 34 | }); |
34 | 35 | |
| 36 | +it("rejects malformed positive integer environment limits", () => { |
| 37 | +expect(readPositiveInt(undefined, 60, "OPENCLAW_RELEASE_BETA_SMOKE_COMMAND_MS")).toBe(60); |
| 38 | +expect(readPositiveInt("", 60, "OPENCLAW_RELEASE_BETA_SMOKE_COMMAND_MS")).toBe(60); |
| 39 | +expect(readPositiveInt("25", 60, "OPENCLAW_RELEASE_BETA_SMOKE_COMMAND_MS")).toBe(25); |
| 40 | + |
| 41 | +for (const raw of ["1e3", "25ms", "1.5", "0", "-1", String(Number.MAX_SAFE_INTEGER + 1)]) { |
| 42 | +expect(() => readPositiveInt(raw, 60, "OPENCLAW_RELEASE_BETA_SMOKE_COMMAND_MS")).toThrow( |
| 43 | +"OPENCLAW_RELEASE_BETA_SMOKE_COMMAND_MS must be a positive integer", |
| 44 | +); |
| 45 | +} |
| 46 | +}); |
| 47 | + |
35 | 48 | it("parses workflow run urls when gh includes them in dispatch output", () => { |
36 | 49 | expect( |
37 | 50 | parseWorkflowRunIdFromOutput( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。