fix(e2e): validate onboard gateway wait attempts · openclaw/openclaw@1faf817
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -177,6 +177,47 @@ test ! -e "$ONBOARD_TMP_DIR"
|
177 | 177 | } |
178 | 178 | }); |
179 | 179 | |
| 180 | +it("rejects invalid onboarding gateway wait attempts before probing", async () => { |
| 181 | +const tempRoot = await mkdtemp(path.join(tmpdir(), "openclaw-onboard-gateway-attempts-")); |
| 182 | +const fixturePath = path.join(tempRoot, "gateway-attempts.sh"); |
| 183 | +await writeFile( |
| 184 | +fixturePath, |
| 185 | +`#!/usr/bin/env bash |
| 186 | +set -euo pipefail |
| 187 | + |
| 188 | +export OPENCLAW_ONBOARD_SCENARIO_SOURCE_ONLY=1 |
| 189 | +export OPENCLAW_ONBOARD_E2E_TMPDIR=${JSON.stringify(tempRoot)} |
| 190 | +export OPENCLAW_ONBOARD_GATEWAY_WAIT_ATTEMPTS=2x |
| 191 | +OPENCLAW_ENTRY=node |
| 192 | +source scripts/e2e/lib/onboard/scenario.sh |
| 193 | + |
| 194 | +openclaw_e2e_probe_tcp() { |
| 195 | + echo "probe should not run" >&2 |
| 196 | + return 1 |
| 197 | +} |
| 198 | +set +e |
| 199 | +wait_for_gateway |
| 200 | +status="$?" |
| 201 | +set -e |
| 202 | +cleanup_onboard_artifacts |
| 203 | +exit "$status" |
| 204 | +`, |
| 205 | +); |
| 206 | + |
| 207 | +try { |
| 208 | +const result = spawnSync("bash", [fixturePath], { |
| 209 | +cwd: process.cwd(), |
| 210 | +encoding: "utf8", |
| 211 | +}); |
| 212 | + |
| 213 | +expect(result.status).toBe(2); |
| 214 | +expect(result.stderr).toContain("invalid OPENCLAW_ONBOARD_GATEWAY_WAIT_ATTEMPTS: 2x"); |
| 215 | +expect(result.stderr).not.toContain("probe should not run"); |
| 216 | +} finally { |
| 217 | +await rm(tempRoot, { force: true, recursive: true }); |
| 218 | +} |
| 219 | +}); |
| 220 | + |
180 | 221 | it("removes fallback ClawHub skill install HOME on failure", async () => { |
181 | 222 | const tempRoot = await mkdtemp(path.join(tmpdir(), "openclaw-clawhub-home-test-")); |
182 | 223 | const fakeBin = path.join(tempRoot, "bin"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。