@@ -717,6 +717,48 @@ test -d "$SCRATCH_ROOT"
|
717 | 717 | } |
718 | 718 | }); |
719 | 719 | |
| 720 | +it("rejects invalid ClawHub fixture wait attempts before starting the server", () => { |
| 721 | +const parent = mkdtempSync(path.join(tmpdir(), "openclaw-kitchen-sink-clawhub-attempts-")); |
| 722 | +const fakeBin = path.join(parent, "bin"); |
| 723 | +const scratchRoot = path.join(parent, "scratch"); |
| 724 | +const fixtureDir = path.join(scratchRoot, "clawhub-fixture"); |
| 725 | +const nodeShim = path.join(fakeBin, "node"); |
| 726 | +try { |
| 727 | +mkdirSync(fakeBin, { recursive: true }); |
| 728 | +mkdirSync(fixtureDir, { recursive: true }); |
| 729 | +writeFileSync(nodeShim, "#!/usr/bin/env bash\necho node should not run >&2\nexit 1\n"); |
| 730 | +chmodSync(nodeShim, 0o755); |
| 731 | + |
| 732 | +const result = runSweepShell( |
| 733 | +` |
| 734 | +set -euo pipefail |
| 735 | +export PATH="$FAKE_BIN:$PATH" |
| 736 | +export KITCHEN_SINK_SWEEP_SOURCE_ONLY=1 |
| 737 | +export KITCHEN_SINK_TMP_DIR="$SCRATCH_ROOT" |
| 738 | +export OPENCLAW_CLAWHUB_FIXTURE_WAIT_ATTEMPTS=2x |
| 739 | +source scripts/e2e/lib/kitchen-sink-plugin/sweep.sh |
| 740 | +set +e |
| 741 | +start_kitchen_sink_clawhub_fixture_server "$FIXTURE_DIR" |
| 742 | +status="$?" |
| 743 | +set -e |
| 744 | +cleanup_kitchen_sink_sweep |
| 745 | +exit "$status" |
| 746 | +`, |
| 747 | +{ |
| 748 | +FAKE_BIN: fakeBin, |
| 749 | +FIXTURE_DIR: fixtureDir, |
| 750 | +SCRATCH_ROOT: scratchRoot, |
| 751 | +}, |
| 752 | +); |
| 753 | + |
| 754 | +expect(result.status).toBe(2); |
| 755 | +expect(result.stderr).toContain("invalid OPENCLAW_CLAWHUB_FIXTURE_WAIT_ATTEMPTS: 2x"); |
| 756 | +expect(result.stderr).not.toContain("node should not run"); |
| 757 | +} finally { |
| 758 | +rmSync(parent, { force: true, recursive: true }); |
| 759 | +} |
| 760 | +}); |
| 761 | + |
720 | 762 | it("bounds ClawHub fixture server logs on startup timeout", () => { |
721 | 763 | const parent = mkdtempSync(path.join(tmpdir(), "openclaw-kitchen-sink-clawhub-log-")); |
722 | 764 | const fakeBin = path.join(parent, "bin"); |
|