fix(e2e): time out live image pulls

This commit is contained in:
Vincent Koc
2026-05-26 12:48:38 +02:00
parent fe9f28f520
commit f0599fddac
3 changed files with 18 additions and 4 deletions

View File

@@ -5,6 +5,8 @@ SCRIPT_ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
ROOT_DIR="${OPENCLAW_LIVE_DOCKER_REPO_ROOT:-$SCRIPT_ROOT_DIR}"
ROOT_DIR="$(cd "$ROOT_DIR" && pwd)"
source "$SCRIPT_ROOT_DIR/scripts/lib/docker-build.sh"
source "$SCRIPT_ROOT_DIR/scripts/lib/docker-e2e-container.sh"
DOCKER_COMMAND_TIMEOUT="${DOCKER_COMMAND_TIMEOUT:-${OPENCLAW_LIVE_DOCKER_PULL_TIMEOUT:-600s}}"
IMAGE_NAME="${OPENCLAW_IMAGE:-openclaw:local}"
LIVE_IMAGE_NAME="${OPENCLAW_LIVE_IMAGE:-${IMAGE_NAME}-live}"
DOCKER_BUILD_EXTENSIONS="${OPENCLAW_DOCKER_BUILD_EXTENSIONS:-${OPENCLAW_EXTENSIONS:-}}"
@@ -24,11 +26,11 @@ fi
if [[ "${OPENCLAW_SKIP_DOCKER_BUILD:-}" == "1" ]]; then
echo "==> Reuse live-test image: $LIVE_IMAGE_NAME"
if docker image inspect "$LIVE_IMAGE_NAME" >/dev/null 2>&1; then
if docker_e2e_docker_cmd image inspect "$LIVE_IMAGE_NAME" >/dev/null 2>&1; then
exit 0
fi
echo "==> Live-test image not found locally; pulling: $LIVE_IMAGE_NAME"
if docker pull "$LIVE_IMAGE_NAME"; then
if docker_e2e_docker_cmd pull "$LIVE_IMAGE_NAME"; then
exit 0
fi
if ! docker_build_on_missing_enabled; then

View File

@@ -146,8 +146,14 @@ describe("docker build helper", () => {
expect(e2eImageHelper).toContain("Docker image not available; building");
expect(e2eImageHelper).toContain('docker_e2e_docker_cmd image inspect "$image_name"');
expect(e2eImageHelper).toContain('docker_e2e_docker_cmd pull "$image_name"');
expect(liveBuild).toContain("docker image inspect");
expect(liveBuild).toContain("docker pull");
expect(liveBuild).toContain('source "$SCRIPT_ROOT_DIR/scripts/lib/docker-e2e-container.sh"');
expect(liveBuild).toContain(
'DOCKER_COMMAND_TIMEOUT="${DOCKER_COMMAND_TIMEOUT:-${OPENCLAW_LIVE_DOCKER_PULL_TIMEOUT:-600s}}"',
);
expect(liveBuild).toContain('docker_e2e_docker_cmd image inspect "$LIVE_IMAGE_NAME"');
expect(liveBuild).toContain('docker_e2e_docker_cmd pull "$LIVE_IMAGE_NAME"');
expect(liveBuild).not.toContain('docker image inspect "$LIVE_IMAGE_NAME"');
expect(liveBuild).not.toContain('docker pull "$LIVE_IMAGE_NAME"');
expect(liveBuild).toContain("Live-test image not available; building");
expect(liveCliBackend).toContain(
'OPENCLAW_LIVE_DOCKER_REPO_ROOT="$ROOT_DIR" "$TRUSTED_HARNESS_DIR/scripts/test-live-build-docker.sh"',

View File

@@ -688,6 +688,12 @@ describe("package artifact reuse", () => {
);
expect(build).toContain('ROOT_DIR="${OPENCLAW_LIVE_DOCKER_REPO_ROOT:-$SCRIPT_ROOT_DIR}"');
expect(build).toContain('source "$SCRIPT_ROOT_DIR/scripts/lib/docker-build.sh"');
expect(build).toContain('source "$SCRIPT_ROOT_DIR/scripts/lib/docker-e2e-container.sh"');
expect(build).toContain(
'DOCKER_COMMAND_TIMEOUT="${DOCKER_COMMAND_TIMEOUT:-${OPENCLAW_LIVE_DOCKER_PULL_TIMEOUT:-600s}}"',
);
expect(build).toContain('docker_e2e_docker_cmd pull "$LIVE_IMAGE_NAME"');
expect(build).not.toContain('docker pull "$LIVE_IMAGE_NAME"');
expect(stage).toContain(
'local scripts_dir="${OPENCLAW_LIVE_DOCKER_SCRIPTS_DIR:-/src/scripts}"',
);