
























@@ -5,6 +5,7 @@ import { runInNewContext } from "node:vm";
55import { describe, expect, it } from "vitest";
6677const SCRIPT_PATH = "scripts/test-install-sh-docker.sh";
8+const INSTALL_E2E_RUNNER_PATH = "scripts/docker/install-sh-e2e/run.sh";
89const DOCKER_SETUP_PATH = "scripts/docker/setup.sh";
910const PODMAN_SETUP_PATH = "scripts/podman/setup.sh";
1011const PODMAN_RUN_PATH = "scripts/run-openclaw-podman.sh";
@@ -468,6 +469,46 @@ describe("test-install-sh-docker", () => {
468469});
469470});
470471472+describe("install-sh E2E runner", () => {
473+it("validates agent timing and toggle knobs before running provider setup", () => {
474+const script = readFileSync(INSTALL_E2E_RUNNER_PATH, "utf8");
475+476+expect(script).toContain(
477+'AGENT_TURN_TIMEOUT_SECONDS="$(read_positive_int_env OPENCLAW_INSTALL_E2E_AGENT_TURN_TIMEOUT_SECONDS 300)"',
478+);
479+expect(script).toContain(
480+'AGENT_TURNS_PARALLEL="$(read_boolean_env OPENCLAW_INSTALL_E2E_AGENT_TURNS_PARALLEL 1)"',
481+);
482+expect(script).toContain(
483+'AGENT_TOOL_SMOKE="$(read_boolean_env OPENCLAW_INSTALL_E2E_AGENT_TOOL_SMOKE 1)"',
484+);
485+expect(script).toContain(
486+'OPENAI_PROVIDER_TIMEOUT_SECONDS="$(read_positive_int_env OPENCLAW_INSTALL_E2E_OPENAI_PROVIDER_TIMEOUT_SECONDS "$AGENT_TURN_TIMEOUT_SECONDS")"',
487+);
488+expect(script).toContain('timeout --kill-after=15s "${AGENT_TURN_TIMEOUT_SECONDS}s"');
489+expect(script).toContain('\\"timeoutSeconds\\":${OPENAI_PROVIDER_TIMEOUT_SECONDS}');
490+});
491+492+it.each([
493+["turn timeout", "OPENCLAW_INSTALL_E2E_AGENT_TURN_TIMEOUT_SECONDS", "300s"],
494+["provider timeout", "OPENCLAW_INSTALL_E2E_OPENAI_PROVIDER_TIMEOUT_SECONDS", "1e3"],
495+["parallel toggle", "OPENCLAW_INSTALL_E2E_AGENT_TURNS_PARALLEL", "2"],
496+["tool smoke toggle", "OPENCLAW_INSTALL_E2E_AGENT_TOOL_SMOKE", "false"],
497+])("rejects invalid install E2E %s before credential preflight", (_label, envName, value) => {
498+const result = spawnSync("bash", [INSTALL_E2E_RUNNER_PATH], {
499+encoding: "utf8",
500+env: {
501+ ...process.env,
502+[envName]: value,
503+},
504+});
505+506+expect(result.status).toBe(2);
507+expect(result.stderr).toContain(`invalid ${envName}: ${value}`);
508+expect(result.stderr).not.toContain("OPENCLAW_E2E_MODELS=both requires");
509+});
510+});
511+471512describe("install-sh smoke runner", () => {
472513it("wraps long npm/update operations with heartbeat and install-size audits", () => {
473514const script = readFileSync(SMOKE_RUNNER_PATH, "utf8");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。