fix(qa): reject duplicate cli bench controls · openclaw/openclaw@524e197
vincentkoc
·
2026-06-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -82,6 +82,35 @@ describe("bench-cli-startup", () => {
|
82 | 82 | expect(result.stderr).not.toContain("\n at "); |
83 | 83 | }); |
84 | 84 | |
| 85 | +it("rejects duplicate single-value controls before running benchmarks", () => { |
| 86 | +expect(() => |
| 87 | +testing.validateCliArgs(["--output", "one.json", "--output", "two.json"]), |
| 88 | +).toThrow("--output was provided more than once"); |
| 89 | + |
| 90 | +const result = spawnSync( |
| 91 | +process.execPath, |
| 92 | +[ |
| 93 | +"--import", |
| 94 | +"tsx", |
| 95 | +"scripts/bench-cli-startup.ts", |
| 96 | +"--output", |
| 97 | +"one.json", |
| 98 | +"--output", |
| 99 | +"two.json", |
| 100 | +], |
| 101 | +{ |
| 102 | +cwd: join(__dirname, "../.."), |
| 103 | +encoding: "utf8", |
| 104 | +}, |
| 105 | +); |
| 106 | + |
| 107 | +expect(result.status).toBe(1); |
| 108 | +expect(result.stdout).toBe(""); |
| 109 | +expect(result.stderr.trim()).toBe("--output was provided more than once"); |
| 110 | +expect(result.stderr).not.toContain("Node.js"); |
| 111 | +expect(result.stderr).not.toContain("\n at "); |
| 112 | +}); |
| 113 | + |
85 | 114 | it.runIf(process.platform !== "win32")( |
86 | 115 | "cleans timed-out benchmark process groups when the leader exits first", |
87 | 116 | () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。