Skip to content

Commit cda4cc5

Browse files
committed
test(docker): bound package proof launch
1 parent ae0f586 commit cda4cc5

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎scripts/e2e/package-openclaw-for-docker.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ IMAGE_NAME="$(docker_e2e_resolve_image "openclaw-docker-e2e-bare:local")"
88
PACKAGE_TGZ="$(docker_e2e_prepare_package_tgz package-openclaw-for-docker "${OPENCLAW_CURRENT_PACKAGE_TGZ:-}")"
99
IDENTITY_PATH="${OPENCLAW_DOCKER_ARTIFACT_IDENTITY_PATH:-$ROOT_DIR/.artifacts/docker-tests/package-openclaw-for-docker-identities.json}"
1010
CONTAINER_NAME="openclaw-package-proof-$$"
11+
DOCKER_RUN_TIMEOUT="${OPENCLAW_PACKAGE_OPENCLAW_FOR_DOCKER_RUN_TIMEOUT:-120s}"
1112

1213
cleanup() {
1314
docker_e2e_docker_cmd rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true
@@ -18,7 +19,7 @@ trap cleanup EXIT
1819
docker_e2e_build_or_reuse "$IMAGE_NAME" package-openclaw-for-docker "$ROOT_DIR/scripts/e2e/Dockerfile" "$ROOT_DIR" bare
1920

2021
echo "Installing the real OpenClaw package artifact in the target container..."
21-
docker run -d \
22+
DOCKER_COMMAND_TIMEOUT="$DOCKER_RUN_TIMEOUT" docker_e2e_docker_run_cmd run -d \
2223
--name "$CONTAINER_NAME" \
2324
-v "$PACKAGE_TGZ:/tmp/openclaw-current.tgz:ro" \
2425
"$IMAGE_NAME" \

‎test/scripts/docker-build-helper.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const DOCKER_E2E_PACKAGE_HELPER_PATH = "scripts/lib/docker-e2e-package.sh";
2121
const DOCKER_E2E_IMAGE_HELPER_PATH = "scripts/lib/docker-e2e-image.sh";
2222
const DOCKER_E2E_SCENARIOS_PATH = "scripts/lib/docker-e2e-scenarios.mjs";
2323
const DOCKER_COMPOSE_SETUP_E2E_PATH = "scripts/e2e/docker-compose-setup-docker.sh";
24+
const PACKAGE_OPENCLAW_FOR_DOCKER_E2E_PATH = "scripts/e2e/package-openclaw-for-docker.sh";
2425
const INSTALL_E2E_RUNNER_PATH = "scripts/docker/install-sh-e2e/run.sh";
2526
const CLEANUP_DOCKER_SMOKE_PATH = "scripts/test-cleanup-docker.sh";
2627
const INSTALL_E2E_DOCKER_SMOKE_PATH = "scripts/test-install-sh-e2e-docker.sh";
@@ -3774,6 +3775,15 @@ output="$(cat "$sampler_log")"
37743775
const composeRunner = readFileSync(DOCKER_COMPOSE_SETUP_E2E_PATH, "utf8");
37753776
expect(composeRunner).not.toMatch(/(^|\n)\s*docker rm -f "\$CLI_NAME"/u);
37763777
expect(composeRunner).toContain('docker_e2e_docker_cmd rm -f "$CLI_NAME"');
3778+
3779+
const packageRunner = readFileSync(PACKAGE_OPENCLAW_FOR_DOCKER_E2E_PATH, "utf8");
3780+
expect(packageRunner).toContain(
3781+
'DOCKER_RUN_TIMEOUT="${OPENCLAW_PACKAGE_OPENCLAW_FOR_DOCKER_RUN_TIMEOUT:-120s}"',
3782+
);
3783+
expect(packageRunner).toContain(
3784+
'DOCKER_COMMAND_TIMEOUT="$DOCKER_RUN_TIMEOUT" docker_e2e_docker_run_cmd run -d',
3785+
);
3786+
expect(packageRunner).not.toMatch(/(^|\n)docker run -d/u);
37773787
});
37783788

37793789
it("routes the gateway network client through the timeout-aware run helper", () => {

0 commit comments

Comments
 (0)