mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(e2e): time out installer smoke containers
This commit is contained in:
@@ -7,6 +7,11 @@ source "$ROOT_DIR/scripts/docker/install-sh-common/version-parse.sh"
|
||||
source "$ROOT_DIR/scripts/lib/docker-build.sh"
|
||||
source "$ROOT_DIR/scripts/lib/docker-e2e-container.sh"
|
||||
DOCKER_COMMAND_TIMEOUT="${DOCKER_COMMAND_TIMEOUT:-${OPENCLAW_INSTALL_SMOKE_DOCKER_COMMAND_TIMEOUT:-600s}}"
|
||||
INSTALL_SMOKE_DOCKER_RUN_TIMEOUT="${OPENCLAW_INSTALL_SMOKE_DOCKER_RUN_TIMEOUT:-2700s}"
|
||||
|
||||
run_install_smoke_container() {
|
||||
DOCKER_COMMAND_TIMEOUT="$INSTALL_SMOKE_DOCKER_RUN_TIMEOUT" docker_e2e_docker_run_cmd run "$@"
|
||||
}
|
||||
|
||||
resolve_default_smoke_platform() {
|
||||
local host_os
|
||||
@@ -417,7 +422,7 @@ else
|
||||
start_update_server
|
||||
|
||||
echo "==> Run installer smoke test (root): $FRESH_TAG_URL"
|
||||
docker run --rm -t \
|
||||
run_install_smoke_container --rm -t \
|
||||
--platform "$SMOKE_PLATFORM" \
|
||||
${UPDATE_DOCKER_HOST_ARGS[@]+"${UPDATE_DOCKER_HOST_ARGS[@]}"} \
|
||||
"${NPM_CACHE_DOCKER_ARGS[@]}" \
|
||||
@@ -441,7 +446,7 @@ else
|
||||
fi
|
||||
|
||||
echo "==> Run update smoke (${UPDATE_BASELINE_VERSION} -> ${UPDATE_EXPECT_VERSION})"
|
||||
docker run --rm -t \
|
||||
run_install_smoke_container --rm -t \
|
||||
--platform "$SMOKE_PLATFORM" \
|
||||
${UPDATE_DOCKER_HOST_ARGS[@]+"${UPDATE_DOCKER_HOST_ARGS[@]}"} \
|
||||
"${NPM_CACHE_DOCKER_ARGS[@]}" \
|
||||
@@ -461,7 +466,7 @@ else
|
||||
echo "==> Skip direct npm global smoke (OPENCLAW_INSTALL_SMOKE_SKIP_NPM_GLOBAL=1)"
|
||||
else
|
||||
echo "==> Run direct npm global smoke (${UPDATE_BASELINE_VERSION} -> ${UPDATE_EXPECT_VERSION})"
|
||||
docker run --rm -t \
|
||||
run_install_smoke_container --rm -t \
|
||||
--platform "$SMOKE_PLATFORM" \
|
||||
${UPDATE_DOCKER_HOST_ARGS[@]+"${UPDATE_DOCKER_HOST_ARGS[@]}"} \
|
||||
"${NPM_CACHE_DOCKER_ARGS[@]}" \
|
||||
@@ -484,7 +489,7 @@ if [[ "$SKIP_FRESHNESS" == "1" ]]; then
|
||||
else
|
||||
prepare_npm_cache
|
||||
echo "==> Run installer npm freshness smoke"
|
||||
docker run --rm -t \
|
||||
run_install_smoke_container --rm -t \
|
||||
--platform "$SMOKE_PLATFORM" \
|
||||
"${NPM_CACHE_DOCKER_ARGS[@]}" \
|
||||
"${INSTALL_SCRIPT_DOCKER_ARGS[@]}" \
|
||||
@@ -518,7 +523,7 @@ else
|
||||
fi
|
||||
|
||||
echo "==> Run installer non-root test: $INSTALL_URL"
|
||||
docker run --rm -t \
|
||||
run_install_smoke_container --rm -t \
|
||||
--platform "$NONROOT_PLATFORM" \
|
||||
"${INSTALL_SCRIPT_DOCKER_ARGS[@]}" \
|
||||
-e OPENCLAW_INSTALL_URL="$INSTALL_URL" \
|
||||
@@ -542,7 +547,7 @@ if [[ "$SKIP_NONROOT" == "1" ]]; then
|
||||
fi
|
||||
|
||||
echo "==> Run CLI installer non-root test (same image)"
|
||||
docker run --rm -t \
|
||||
run_install_smoke_container --rm -t \
|
||||
--platform "$NONROOT_PLATFORM" \
|
||||
--entrypoint /bin/bash \
|
||||
"${INSTALL_SCRIPT_DOCKER_ARGS[@]}" \
|
||||
|
||||
@@ -80,6 +80,20 @@ describe("test-install-sh-docker", () => {
|
||||
expect(dockerfile).toContain("node scripts/check-package-dist-imports.mjs /app");
|
||||
});
|
||||
|
||||
it("bounds installer smoke container runs", () => {
|
||||
const script = readFileSync(SCRIPT_PATH, "utf8");
|
||||
|
||||
expect(script).toContain(
|
||||
'INSTALL_SMOKE_DOCKER_RUN_TIMEOUT="${OPENCLAW_INSTALL_SMOKE_DOCKER_RUN_TIMEOUT:-2700s}"',
|
||||
);
|
||||
expect(script).toContain("run_install_smoke_container()");
|
||||
expect(script).toContain(
|
||||
'DOCKER_COMMAND_TIMEOUT="$INSTALL_SMOKE_DOCKER_RUN_TIMEOUT" docker_e2e_docker_run_cmd run "$@"',
|
||||
);
|
||||
expect(script.match(/run_install_smoke_container --rm -t/g)?.length).toBe(6);
|
||||
expect(script).not.toContain("docker run --rm -t \\");
|
||||
});
|
||||
|
||||
it("runs the root Dockerfile build with the CI heap limit", () => {
|
||||
const dockerfile = readFileSync("Dockerfile", "utf8");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user