mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 17:53:39 +00:00
62 lines
2.5 KiB
Bash
Executable file
62 lines
2.5 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Bash 5.3+ can deadlock writing heredoc pipes on macOS before the reader starts.
|
|
if [[ ${OSTYPE:-} == darwin* && $BASH != /bin/bash ]] && ((BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 3))); then
|
|
exec /bin/bash "$0" "$@"
|
|
fi
|
|
# Verifies unchanged plugin updates and explicit capability consent during update/repair.
|
|
# The CLI under test is installed from the prepared npm tarball in a bare runner.
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
source "$ROOT_DIR/scripts/lib/docker-e2e-image.sh"
|
|
source "$ROOT_DIR/scripts/lib/docker-e2e-package.sh"
|
|
|
|
IMAGE_NAME="$(docker_e2e_resolve_image "openclaw-plugin-update-e2e" OPENCLAW_PLUGIN_UPDATE_E2E_IMAGE)"
|
|
SKIP_BUILD="${OPENCLAW_PLUGIN_UPDATE_E2E_SKIP_BUILD:-0}"
|
|
cleanup() {
|
|
docker_e2e_cleanup_package_tgz "${PACKAGE_TGZ:-}"
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
PACKAGE_TGZ="$(docker_e2e_prepare_package_tgz plugin-update "${OPENCLAW_CURRENT_PACKAGE_TGZ:-}")"
|
|
# Bare lanes mount the package artifact instead of baking app sources into the image.
|
|
docker_e2e_package_mount_args "$PACKAGE_TGZ"
|
|
|
|
CORE_UPDATE_CONSENT=1
|
|
source "$ROOT_DIR/scripts/lib/frozen-target-compat.sh"
|
|
TARGET_ROOT_DIR="$(cd "${OPENCLAW_DOCKER_E2E_REPO_ROOT:-$ROOT_DIR}" && pwd)"
|
|
context_status=0
|
|
openclaw_prepare_frozen_target_context "$TARGET_ROOT_DIR" || context_status=$?
|
|
case "$context_status" in
|
|
0)
|
|
source_status=0
|
|
openclaw_frozen_target_source_has_path \
|
|
"$TARGET_ROOT_DIR" scripts/lib/update-compat-contract.mjs || source_status=$?
|
|
case "$source_status" in
|
|
0) ;;
|
|
1) CORE_UPDATE_CONSENT=0 ;;
|
|
*) exit "$source_status" ;;
|
|
esac
|
|
;;
|
|
1) ;;
|
|
*) exit "$context_status" ;;
|
|
esac
|
|
|
|
docker_e2e_build_or_reuse "$IMAGE_NAME" plugin-update "$ROOT_DIR/scripts/e2e/Dockerfile" "$ROOT_DIR" "bare" "$SKIP_BUILD"
|
|
OPENCLAW_TEST_STATE_SCRIPT_B64="$(docker_e2e_test_state_shell_b64 plugin-update empty)"
|
|
|
|
echo "Running unchanged plugin update and capability consent smoke..."
|
|
docker_e2e_run_with_harness \
|
|
-e COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
|
|
-e "OPENCLAW_E2E_CORE_UPDATE_CONSENT=$CORE_UPDATE_CONSENT" \
|
|
-e OPENCLAW_SKIP_CHANNELS=1 \
|
|
-e OPENCLAW_SKIP_PROVIDERS=1 \
|
|
-e "OPENCLAW_TEST_STATE_SCRIPT_B64=$OPENCLAW_TEST_STATE_SCRIPT_B64" \
|
|
"${DOCKER_E2E_PACKAGE_ARGS[@]}" \
|
|
"$IMAGE_NAME" \
|
|
bash -e -c '
|
|
bash scripts/e2e/lib/plugin-update/consent-scenario.sh
|
|
bash scripts/e2e/lib/plugin-update/unchanged-scenario.sh
|
|
'
|
|
|
|
echo "Plugin update unchanged and consent Docker E2E passed."
|