mirror of
https://github.com/bitbaum/openclaw.git
synced 2026-12-04 05:07:18 +01:00
* fix(ci): accept plugin fixture capabilities * fix(ci): detect fixture capability consent support Probe candidate command help through the existing bounded E2E runners so positive fixtures accept capabilities only when that command supports it. Preserve historical packages, probe failures, argv, and child exit status; keep negative, no-op, and integrity-bound update coverage unapproved. Replace duplicated probes and source-string checks with executable compatibility regressions. Synchronize the RPC timeout test with real process readiness before advancing its unchanged 100 ms deadline, while retaining real process-group termination and cleanup. Co-authored-by: Vincent Koc <vincentkoc@ieee.org> * fix(ci): run Docker lanes from trusted harness Resolve package scripts and packaging tools from the trusted harness while keeping candidate source, artifacts, registry identity, and preflight on the frozen target. Remove candidate-script lane filtering and the duplicate live command wrapper; preserve source inputs in source-built Docker lanes. Prove the public scheduler boundary with distinct harness/target roots and poisoned candidate scripts. Synchronize scheduler timeout fixtures with real child readiness, retain real signals and kill grace, and handle empty QR build arguments on Bash 3. Co-authored-by: Vincent Koc <vincentkoc@ieee.org> * test(ci): retire superseded harness source assertions Keep the workflow trust and pnpm PATH guards, but remove checks for the old inline replacement and deleted duplicate live-script wrapper. The public scheduler regressions now prove those behaviors through distinct candidate/harness roots and quoted pinned pnpm commands. Co-authored-by: Vincent Koc <vincentkoc@ieee.org> * test(ci): cover multi-build source roots * fix(ci): select the harness toolchain before Docker lanes Start prepared pnpm commands in the trusted harness before Corepack resolves its package-manager pin. Preserve frozen candidate source and artifact identity, and resolve relative executable and cache paths before changing cwd. Keep quoted rerun environment values out of executable substitution. Cover different toolchain pins, shell-sensitive paths, and generated reruns through the public scheduler boundary. Co-authored-by: Vincent Koc <vincentkoc@ieee.org> --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
333 lines
17 KiB
Bash
333 lines
17 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
source scripts/lib/openclaw-e2e-instance.sh
|
|
source scripts/lib/docker-e2e-logs.sh
|
|
OPENCLAW_PLUGINS_SWEEP_SOURCE_ONLY="${OPENCLAW_PLUGINS_SWEEP_SOURCE_ONLY:-0}"
|
|
if [[ -z "${OPENCLAW_ENTRY:-}" && "$OPENCLAW_PLUGINS_SWEEP_SOURCE_ONLY" != "1" ]]; then
|
|
OPENCLAW_ENTRY="$(openclaw_e2e_resolve_entrypoint)"
|
|
fi
|
|
export OPENCLAW_ENTRY
|
|
OPENCLAW_PLUGINS_CREATED_TMP_DIR=0
|
|
if [[ -z "${OPENCLAW_PLUGINS_TMP_DIR:-}" ]]; then
|
|
OPENCLAW_PLUGINS_TMP_DIR="$(mktemp -d "/tmp/openclaw-plugins.XXXXXX")"
|
|
OPENCLAW_PLUGINS_CREATED_TMP_DIR=1
|
|
fi
|
|
export OPENCLAW_PLUGINS_TMP_DIR
|
|
OPENCLAW_PLUGINS_CLI_TIMEOUT="${OPENCLAW_PLUGINS_CLI_TIMEOUT:-180s}"
|
|
mkdir -p "$OPENCLAW_PLUGINS_TMP_DIR"
|
|
|
|
plugins_lifecycle_trace_enabled() {
|
|
case "${OPENCLAW_PLUGIN_LIFECYCLE_TRACE:-}" in
|
|
1 | true | TRUE | yes | YES)
|
|
return 0
|
|
;;
|
|
*)
|
|
return 1
|
|
;;
|
|
esac
|
|
}
|
|
|
|
# Redact complete stderr before truncation so a split credential can never expose its suffix.
|
|
print_plugins_stderr_log() {
|
|
local error_file="$1"
|
|
local redacted_file
|
|
redacted_file="$(mktemp "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-redacted.XXXXXX")" || return $?
|
|
local status=0
|
|
sed -E \
|
|
-e 's/[Bb][Ee][Aa][Rr][Ee][Rr][[:space:]]+[^[:space:]]+/Bearer [REDACTED]/g' \
|
|
-e 's/(^|[^[:alnum:]_])(sk|sess|rk)-[[:alnum:]_-]+/\1[REDACTED]/g' \
|
|
"$error_file" >"$redacted_file" || status=$?
|
|
if [[ "$status" -eq 0 ]]; then
|
|
docker_e2e_print_log "$redacted_file" >&2 || status=$?
|
|
fi
|
|
rm -f "$redacted_file"
|
|
return "$status"
|
|
}
|
|
|
|
run_plugins_openclaw_logged() {
|
|
local label="$1"
|
|
shift
|
|
run_plugins_command_logged "$label" openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" "$@"
|
|
}
|
|
|
|
run_plugins_fixture_logged() {
|
|
local label="$1"
|
|
shift
|
|
run_plugins_command_logged "$label" openclaw_e2e_fixture_plugin_command openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" -- "$@"
|
|
}
|
|
|
|
run_plugins_command_logged() {
|
|
local label="$1"
|
|
shift
|
|
local output_file
|
|
output_file="$(mktemp "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-stdout.XXXXXX")" || return $?
|
|
local error_file
|
|
error_file="$(mktemp "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-stderr.XXXXXX")" || {
|
|
local create_status=$?
|
|
rm -f "$output_file"
|
|
return "$create_status"
|
|
}
|
|
local status=0
|
|
if "$@" >"$output_file" 2>"$error_file"; then
|
|
if plugins_lifecycle_trace_enabled; then
|
|
print_plugins_stderr_log "$error_file" || status=$?
|
|
fi
|
|
else
|
|
status=$?
|
|
if ! print_plugins_stderr_log "$error_file"; then
|
|
printf 'Plugin sweep stderr redaction failed: %s\n' "$label" >&2
|
|
fi
|
|
if [[ "$status" -eq 124 ]]; then
|
|
printf 'Plugin sweep command timed out after %s: %s\n' \
|
|
"$OPENCLAW_PLUGINS_CLI_TIMEOUT" "$label" >&2
|
|
else
|
|
printf 'Plugin sweep command failed with status %s: %s\n' \
|
|
"$status" "$label" >&2
|
|
fi
|
|
fi
|
|
rm -f "$error_file" "$output_file"
|
|
return "$status"
|
|
}
|
|
|
|
run_plugins_openclaw_capture() {
|
|
local output_file="$1"
|
|
shift
|
|
local error_file
|
|
error_file="$(mktemp "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-stderr.XXXXXX")" || return $?
|
|
local status=0
|
|
if openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" "$@" >"$output_file" 2>"$error_file"; then
|
|
print_plugins_stderr_log "$error_file" || status=$?
|
|
else
|
|
status=$?
|
|
if ! print_plugins_stderr_log "$error_file"; then
|
|
printf 'Plugin sweep stderr redaction failed: %s\n' "${output_file##*/}" >&2
|
|
fi
|
|
if [[ "$status" -eq 124 ]]; then
|
|
printf 'Plugin sweep capture timed out after %s: %s\n' \
|
|
"$OPENCLAW_PLUGINS_CLI_TIMEOUT" "${output_file##*/}" >&2
|
|
else
|
|
printf 'Plugin sweep capture failed with status %s: %s\n' \
|
|
"$status" "${output_file##*/}" >&2
|
|
fi
|
|
fi
|
|
rm -f "$error_file"
|
|
return "$status"
|
|
}
|
|
|
|
run_plugins_shell_logged() {
|
|
local label="$1"
|
|
shift
|
|
local command="$1"
|
|
run_logged "$label" openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" bash -c "$command"
|
|
}
|
|
|
|
source scripts/e2e/lib/plugins/fixtures.sh
|
|
source scripts/e2e/lib/plugins/marketplace.sh
|
|
source scripts/e2e/lib/plugins/clawhub.sh
|
|
|
|
cleanup_openclaw_plugins_sweep() {
|
|
openclaw_plugins_cleanup_fixture_servers
|
|
if [[ "${OPENCLAW_PLUGINS_CREATED_TMP_DIR:-0}" = "1" ]]; then
|
|
rm -rf "$OPENCLAW_PLUGINS_TMP_DIR"
|
|
fi
|
|
}
|
|
|
|
if [[ "$OPENCLAW_PLUGINS_SWEEP_SOURCE_ONLY" = "1" ]]; then
|
|
return 0 2>/dev/null || { cleanup_openclaw_plugins_sweep; exit 0; }
|
|
fi
|
|
|
|
trap cleanup_openclaw_plugins_sweep EXIT
|
|
|
|
openclaw_e2e_eval_test_state_from_b64 "${OPENCLAW_TEST_STATE_SCRIPT_B64:?missing OPENCLAW_TEST_STATE_SCRIPT_B64}"
|
|
PACKAGE_VERSION="$(node -p 'require("./package.json").version')"
|
|
OPENCLAW_PACKAGE_ACCEPTANCE_LEGACY_COMPAT="$(node scripts/e2e/lib/package-compat.mjs "$PACKAGE_VERSION")"
|
|
export OPENCLAW_PACKAGE_ACCEPTANCE_LEGACY_COMPAT
|
|
BUNDLED_PLUGIN_ROOT_DIR="extensions"
|
|
OPENCLAW_PLUGIN_HOME="$HOME/.openclaw/$BUNDLED_PLUGIN_ROOT_DIR"
|
|
|
|
demo_plugin_id="demo-plugin"
|
|
demo_plugin_root="$OPENCLAW_PLUGIN_HOME/$demo_plugin_id"
|
|
write_demo_fixture_plugin "$demo_plugin_root"
|
|
record_fixture_plugin_trust "$demo_plugin_id" "$demo_plugin_root" 1
|
|
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins.json" plugins list --json
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-inspect.json" plugins inspect demo-plugin --runtime --json
|
|
|
|
node scripts/e2e/lib/plugins/assertions.mjs demo-plugin
|
|
|
|
echo "Testing tgz install flow..."
|
|
pack_dir="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-pack.XXXXXX")"
|
|
pack_fixture_plugin "$pack_dir" "$OPENCLAW_PLUGINS_TMP_DIR/demo-plugin-tgz.tgz" demo-plugin-tgz 0.0.1 demo.tgz "Demo Plugin TGZ"
|
|
|
|
run_plugins_fixture_logged install-tgz plugins install "$OPENCLAW_PLUGINS_TMP_DIR/demo-plugin-tgz.tgz" --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins2.json" plugins list --json
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins2-inspect.json" plugins inspect demo-plugin-tgz --runtime --json
|
|
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-tgz
|
|
|
|
run_plugins_openclaw_logged uninstall-tgz plugins uninstall demo-plugin-tgz --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins2-uninstalled.json" plugins list --json
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-tgz-removed
|
|
|
|
echo "Testing install from local folder (plugins.load.paths)..."
|
|
dir_plugin="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-dir.XXXXXX")"
|
|
write_fixture_plugin "$dir_plugin" demo-plugin-dir 0.0.1 demo.dir "Demo Plugin DIR"
|
|
|
|
run_plugins_fixture_logged install-dir plugins install "$dir_plugin" --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins3.json" plugins list --json
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins3-inspect.json" plugins inspect demo-plugin-dir --runtime --json
|
|
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-dir "$dir_plugin"
|
|
|
|
openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" plugins update demo-plugin-dir >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-update.log" 2>&1
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-dir-update-skipped
|
|
|
|
run_plugins_openclaw_logged uninstall-dir plugins uninstall demo-plugin-dir --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins3-uninstalled.json" plugins list --json
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-dir-removed
|
|
|
|
echo "Testing install from local folder with preinstalled dependencies..."
|
|
dir_deps_plugin="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-dir-deps.XXXXXX")"
|
|
write_fixture_plugin_with_vendored_dependency "$dir_deps_plugin" demo-plugin-dir-deps 0.0.1 demo.dir.deps "Demo Plugin DIR Deps"
|
|
|
|
run_plugins_fixture_logged install-dir-deps plugins install "$dir_deps_plugin" --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-deps.json" plugins list --json
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-deps-inspect.json" plugins inspect demo-plugin-dir-deps --runtime --json
|
|
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-dir-deps "$dir_deps_plugin"
|
|
|
|
run_plugins_openclaw_logged uninstall-dir-deps plugins uninstall demo-plugin-dir-deps --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-deps-uninstalled.json" plugins list --json
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-dir-deps-removed
|
|
|
|
echo "Testing install from npm spec (file:)..."
|
|
file_pack_dir="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-filepack.XXXXXX")"
|
|
write_fixture_plugin "$file_pack_dir/package" demo-plugin-file 0.0.1 demo.file "Demo Plugin FILE"
|
|
|
|
run_plugins_fixture_logged install-file plugins install "file:$file_pack_dir/package" --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins4.json" plugins list --json
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins4-inspect.json" plugins inspect demo-plugin-file --runtime --json
|
|
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-file "$file_pack_dir/package"
|
|
|
|
run_plugins_openclaw_logged uninstall-file plugins uninstall demo-plugin-file --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins4-uninstalled.json" plugins list --json
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-file-removed
|
|
|
|
echo "Testing install and update from npm registry..."
|
|
npm_pack_dir="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-npm-pack.XXXXXX")"
|
|
npm_dep_pack_dir="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-npm-dep-pack.XXXXXX")"
|
|
invalid_npm_pack_dir="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-invalid-metadata-pack.XXXXXX")"
|
|
npm_registry_dir="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-npm-registry.XXXXXX")"
|
|
pack_fixture_plugin_with_cli_registry_dependency "$npm_pack_dir" "$OPENCLAW_PLUGINS_TMP_DIR/demo-plugin-npm.tgz" demo-plugin-npm 0.0.1 demo.npm "Demo Plugin NPM" demo-npm "demo-plugin-npm:pong"
|
|
pack_fake_is_number_package "$npm_dep_pack_dir" "$OPENCLAW_PLUGINS_TMP_DIR/is-number-7.0.0.tgz"
|
|
pack_fixture_plugin_with_invalid_extension_entry "$invalid_npm_pack_dir" "$OPENCLAW_PLUGINS_TMP_DIR/demo-plugin-invalid-metadata.tgz" demo-plugin-invalid-metadata 0.0.1 demo.invalid.metadata "Demo Plugin Invalid Metadata"
|
|
start_npm_fixture_registry "@openclaw/demo-plugin-npm" "0.0.1" "$OPENCLAW_PLUGINS_TMP_DIR/demo-plugin-npm.tgz" "$npm_registry_dir" "is-number" "7.0.0" "$OPENCLAW_PLUGINS_TMP_DIR/is-number-7.0.0.tgz" "@openclaw/demo-plugin-invalid-metadata" "0.0.1" "$OPENCLAW_PLUGINS_TMP_DIR/demo-plugin-invalid-metadata.tgz"
|
|
|
|
run_plugins_fixture_logged install-npm plugins install "npm:@openclaw/demo-plugin-npm@0.0.1" --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm.json" plugins list --json
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-inspect.json" plugins inspect demo-plugin-npm --runtime --json
|
|
run_plugins_shell_logged exec-npm-plugin-cli 'node "$OPENCLAW_ENTRY" demo-npm ping >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-cli.txt"'
|
|
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-npm
|
|
|
|
openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" plugins update demo-plugin-npm >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-update.log" 2>&1
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-npm-update
|
|
|
|
run_plugins_openclaw_logged uninstall-npm-retained plugins uninstall demo-plugin-npm --force --keep-files
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-retained.json" plugins list --json
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-npm-retained
|
|
|
|
run_plugins_fixture_logged reinstall-npm plugins install "npm:@openclaw/demo-plugin-npm@0.0.1" --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm.json" plugins list --json
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-inspect.json" plugins inspect demo-plugin-npm --runtime --json
|
|
run_plugins_shell_logged exec-reinstalled-npm-plugin-cli 'node "$OPENCLAW_ENTRY" demo-npm ping >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-cli.txt"'
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-npm
|
|
|
|
run_plugins_openclaw_logged uninstall-npm plugins uninstall demo-plugin-npm --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-uninstalled.json" plugins list --json
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-npm-removed
|
|
|
|
echo "Testing npm install rejects malformed package metadata..."
|
|
if openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" plugins install "npm:@openclaw/demo-plugin-invalid-metadata@0.0.1" --force >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-invalid-openclaw-extensions.log" 2>&1; then
|
|
cat "$OPENCLAW_PLUGINS_TMP_DIR/plugins-invalid-openclaw-extensions.log"
|
|
echo "Expected malformed package metadata install to fail." >&2
|
|
exit 1
|
|
fi
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-invalid-openclaw-extensions-list.json" plugins list --json
|
|
node scripts/e2e/lib/plugins/assertions.mjs invalid-openclaw-extensions
|
|
|
|
echo "Testing install from git repo and plugin CLI execution..."
|
|
git_fixture_root="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-git.XXXXXX")"
|
|
git_repo="$git_fixture_root/repo"
|
|
git_repo_url="file://$git_repo"
|
|
write_fixture_plugin_with_cli "$git_repo" demo-plugin-git 0.0.1 demo.git "Demo Plugin Git" demo-git "demo-plugin-git:pong"
|
|
git -C "$git_repo" init -q
|
|
git -C "$git_repo" config user.email "docker-e2e@openclaw.local"
|
|
git -C "$git_repo" config user.name "OpenClaw Docker E2E"
|
|
git -C "$git_repo" add -A
|
|
git -C "$git_repo" commit -qm "test fixture"
|
|
git_ref="$(git -C "$git_repo" rev-parse HEAD)"
|
|
|
|
run_plugins_fixture_logged install-git plugins install "git:$git_repo_url@$git_ref" --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-git.json" plugins list --json
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-inspect.json" plugins inspect demo-plugin-git --runtime --json
|
|
run_plugins_shell_logged exec-git-plugin-cli 'node "$OPENCLAW_ENTRY" demo-git ping >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-cli.txt"'
|
|
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-git "$git_repo_url" "$git_ref"
|
|
|
|
run_plugins_openclaw_logged uninstall-git plugins uninstall demo-plugin-git --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-uninstalled.json" plugins list --json
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-git-removed
|
|
|
|
echo "Testing git plugin update from moving ref..."
|
|
git_update_fixture_root="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-git-update.XXXXXX")"
|
|
git_update_repo="$git_update_fixture_root/repo"
|
|
git_update_repo_url="file://$git_update_repo"
|
|
write_fixture_plugin_with_cli "$git_update_repo" demo-plugin-git-update 0.0.1 demo.git.update.v1 "Demo Plugin Git Update" demo-git-update "demo-plugin-git-update:pong-v1"
|
|
git -C "$git_update_repo" init -q
|
|
git -C "$git_update_repo" config user.email "docker-e2e@openclaw.local"
|
|
git -C "$git_update_repo" config user.name "OpenClaw Docker E2E"
|
|
git -C "$git_update_repo" checkout -qb main
|
|
git -C "$git_update_repo" add -A
|
|
git -C "$git_update_repo" commit -qm "test fixture v1"
|
|
git_update_ref_v1="$(git -C "$git_update_repo" rev-parse HEAD)"
|
|
|
|
run_plugins_fixture_logged install-git-update plugins install "git:$git_update_repo_url@main" --force
|
|
write_fixture_plugin_with_cli "$git_update_repo" demo-plugin-git-update 0.0.2 demo.git.update.v2 "Demo Plugin Git Update" demo-git-update "demo-plugin-git-update:pong-v2"
|
|
git -C "$git_update_repo" add -A
|
|
git -C "$git_update_repo" commit -qm "test fixture v2"
|
|
|
|
openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" plugins update demo-plugin-git-update >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-update.log" 2>&1
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-update.json" plugins list --json
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-update-inspect.json" plugins inspect demo-plugin-git-update --runtime --json
|
|
run_plugins_shell_logged exec-updated-git-plugin-cli 'node "$OPENCLAW_ENTRY" demo-git-update ping >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-update-cli.txt"'
|
|
|
|
node scripts/e2e/lib/plugins/assertions.mjs plugin-git-updated "$git_update_ref_v1"
|
|
|
|
echo "Testing Claude bundle enable and inspect flow..."
|
|
bundle_plugin_id="claude-bundle-e2e"
|
|
bundle_root="$OPENCLAW_PLUGIN_HOME/$bundle_plugin_id"
|
|
write_claude_bundle_fixture "$bundle_root"
|
|
record_fixture_plugin_trust "$bundle_plugin_id" "$bundle_root" 0
|
|
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-bundle-disabled.json" plugins list --json
|
|
node scripts/e2e/lib/plugins/assertions.mjs bundle-disabled
|
|
|
|
run_plugins_fixture_logged enable-claude-bundle plugins enable claude-bundle-e2e
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-bundle-inspect.json" plugins inspect claude-bundle-e2e --json
|
|
node scripts/e2e/lib/plugins/assertions.mjs bundle-inspect
|
|
|
|
echo "Testing plugin install visible after explicit restart..."
|
|
slash_install_dir="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-slash-install.XXXXXX")"
|
|
write_fixture_plugin "$slash_install_dir" slash-install-plugin 0.0.1 demo.slash.install "Slash Install Plugin"
|
|
|
|
run_plugins_fixture_logged install-slash-plugin plugins install "$slash_install_dir" --force
|
|
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugin-command-install-show.json" plugins inspect slash-install-plugin --runtime --json
|
|
node scripts/e2e/lib/plugins/assertions.mjs slash-install
|
|
|
|
run_plugins_marketplace_scenario
|
|
|
|
run_plugins_clawhub_scenario
|