






















@@ -6,11 +6,25 @@ source scripts/lib/docker-e2e-logs.sh
66OPENCLAW_ENTRY="$(openclaw_e2e_resolve_entrypoint)"
77export OPENCLAW_ENTRY
88export OPENCLAW_PLUGINS_TMP_DIR="${OPENCLAW_PLUGINS_TMP_DIR:-/tmp}"
9+OPENCLAW_PLUGINS_CLI_TIMEOUT="${OPENCLAW_PLUGINS_CLI_TIMEOUT:-180s}"
910mkdir -p "$OPENCLAW_PLUGINS_TMP_DIR"
1011PACKAGE_VERSION="$(node -p 'require("./package.json").version')"
1112OPENCLAW_PACKAGE_ACCEPTANCE_LEGACY_COMPAT="$(node scripts/e2e/lib/package-compat.mjs "$PACKAGE_VERSION")"
1213export OPENCLAW_PACKAGE_ACCEPTANCE_LEGACY_COMPAT
131415+run_plugins_openclaw_logged() {
16+local label="$1"
17+shift
18+ run_logged "$label" openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" "$@"
19+}
20+21+run_plugins_shell_logged() {
22+local label="$1"
23+shift
24+local command="$1"
25+ run_logged "$label" openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" bash -c "$command"
26+}
27+1428openclaw_e2e_eval_test_state_from_b64 "${OPENCLAW_TEST_STATE_SCRIPT_B64:?missing OPENCLAW_TEST_STATE_SCRIPT_B64}"
1529BUNDLED_PLUGIN_ROOT_DIR="extensions"
1630OPENCLAW_PLUGIN_HOME="$HOME/.openclaw/$BUNDLED_PLUGIN_ROOT_DIR"
@@ -32,58 +46,58 @@ echo "Testing tgz install flow..."
3246pack_dir="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-pack.XXXXXX")"
3347pack_fixture_plugin "$pack_dir" "$OPENCLAW_PLUGINS_TMP_DIR/demo-plugin-tgz.tgz" demo-plugin-tgz 0.0.1 demo.tgz "Demo Plugin TGZ"
344835-run_logged install-tgz node "$OPENCLAW_ENTRY" plugins install "$OPENCLAW_PLUGINS_TMP_DIR/demo-plugin-tgz.tgz"
49+run_plugins_openclaw_logged install-tgz plugins install "$OPENCLAW_PLUGINS_TMP_DIR/demo-plugin-tgz.tgz"
3650node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins2.json"
3751node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-tgz --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins2-inspect.json"
38523953node scripts/e2e/lib/plugins/assertions.mjs plugin-tgz
405441-run_logged uninstall-tgz node "$OPENCLAW_ENTRY" plugins uninstall demo-plugin-tgz --force
55+run_plugins_openclaw_logged uninstall-tgz plugins uninstall demo-plugin-tgz --force
4256node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins2-uninstalled.json"
4357node scripts/e2e/lib/plugins/assertions.mjs plugin-tgz-removed
44584559echo "Testing install from local folder (plugins.load.paths)..."
4660dir_plugin="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-dir.XXXXXX")"
4761write_fixture_plugin "$dir_plugin" demo-plugin-dir 0.0.1 demo.dir "Demo Plugin DIR"
486249-run_logged install-dir node "$OPENCLAW_ENTRY" plugins install "$dir_plugin"
63+run_plugins_openclaw_logged install-dir plugins install "$dir_plugin"
5064node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins3.json"
5165node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-dir --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins3-inspect.json"
52665367node scripts/e2e/lib/plugins/assertions.mjs plugin-dir "$dir_plugin"
546855-node "$OPENCLAW_ENTRY" plugins update demo-plugin-dir >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-update.log" 2>&1
69+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
5670node scripts/e2e/lib/plugins/assertions.mjs plugin-dir-update-skipped
577158-run_logged uninstall-dir node "$OPENCLAW_ENTRY" plugins uninstall demo-plugin-dir --force
72+run_plugins_openclaw_logged uninstall-dir plugins uninstall demo-plugin-dir --force
5973node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins3-uninstalled.json"
6074node scripts/e2e/lib/plugins/assertions.mjs plugin-dir-removed
61756276echo "Testing install from local folder with preinstalled dependencies..."
6377dir_deps_plugin="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-dir-deps.XXXXXX")"
6478write_fixture_plugin_with_vendored_dependency "$dir_deps_plugin" demo-plugin-dir-deps 0.0.1 demo.dir.deps "Demo Plugin DIR Deps"
657966-run_logged install-dir-deps node "$OPENCLAW_ENTRY" plugins install "$dir_deps_plugin"
80+run_plugins_openclaw_logged install-dir-deps plugins install "$dir_deps_plugin"
6781node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-deps.json"
6882node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-dir-deps --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-deps-inspect.json"
69837084node scripts/e2e/lib/plugins/assertions.mjs plugin-dir-deps "$dir_deps_plugin"
718572-run_logged uninstall-dir-deps node "$OPENCLAW_ENTRY" plugins uninstall demo-plugin-dir-deps --force
86+run_plugins_openclaw_logged uninstall-dir-deps plugins uninstall demo-plugin-dir-deps --force
7387node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-deps-uninstalled.json"
7488node scripts/e2e/lib/plugins/assertions.mjs plugin-dir-deps-removed
75897690echo "Testing install from npm spec (file:)..."
7791file_pack_dir="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-filepack.XXXXXX")"
7892write_fixture_plugin "$file_pack_dir/package" demo-plugin-file 0.0.1 demo.file "Demo Plugin FILE"
799380-run_logged install-file node "$OPENCLAW_ENTRY" plugins install "file:$file_pack_dir/package"
94+run_plugins_openclaw_logged install-file plugins install "file:$file_pack_dir/package"
8195node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins4.json"
8296node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-file --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins4-inspect.json"
83978498node scripts/e2e/lib/plugins/assertions.mjs plugin-file "$file_pack_dir/package"
859986-run_logged uninstall-file node "$OPENCLAW_ENTRY" plugins uninstall demo-plugin-file --force
100+run_plugins_openclaw_logged uninstall-file plugins uninstall demo-plugin-file --force
87101node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins4-uninstalled.json"
88102node scripts/e2e/lib/plugins/assertions.mjs plugin-file-removed
89103@@ -97,22 +111,22 @@ pack_fake_is_number_package "$npm_dep_pack_dir" "$OPENCLAW_PLUGINS_TMP_DIR/is-nu
97111pack_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"
98112start_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"
99113100-run_logged install-npm node "$OPENCLAW_ENTRY" plugins install "npm:@openclaw/demo-plugin-npm@0.0.1"
114+run_plugins_openclaw_logged install-npm plugins install "npm:@openclaw/demo-plugin-npm@0.0.1"
101115node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm.json"
102116node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-npm --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-inspect.json"
103-run_logged exec-npm-plugin-cli bash -c 'node "$OPENCLAW_ENTRY" demo-npm ping >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-cli.txt"'
117+run_plugins_shell_logged exec-npm-plugin-cli 'node "$OPENCLAW_ENTRY" demo-npm ping >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-cli.txt"'
104118105119node scripts/e2e/lib/plugins/assertions.mjs plugin-npm
106120107-node "$OPENCLAW_ENTRY" plugins update demo-plugin-npm >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-update.log" 2>&1
121+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
108122node scripts/e2e/lib/plugins/assertions.mjs plugin-npm-update
109123110-run_logged uninstall-npm node "$OPENCLAW_ENTRY" plugins uninstall demo-plugin-npm --force
124+run_plugins_openclaw_logged uninstall-npm plugins uninstall demo-plugin-npm --force
111125node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-uninstalled.json"
112126node scripts/e2e/lib/plugins/assertions.mjs plugin-npm-removed
113127114128echo "Testing npm install rejects malformed package metadata..."
115-if node "$OPENCLAW_ENTRY" plugins install "npm:@openclaw/demo-plugin-invalid-metadata@0.0.1" >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-invalid-openclaw-extensions.log" 2>&1; then
129+if openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" plugins install "npm:@openclaw/demo-plugin-invalid-metadata@0.0.1" >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-invalid-openclaw-extensions.log" 2>&1; then
116130 cat "$OPENCLAW_PLUGINS_TMP_DIR/plugins-invalid-openclaw-extensions.log"
117131echo "Expected malformed package metadata install to fail." >&2
118132exit 1
@@ -132,14 +146,14 @@ git -C "$git_repo" add -A
132146git -C "$git_repo" commit -qm "test fixture"
133147git_ref="$(git -C "$git_repo" rev-parse HEAD)"
134148135-run_logged install-git node "$OPENCLAW_ENTRY" plugins install "git:$git_repo_url@$git_ref"
149+run_plugins_openclaw_logged install-git plugins install "git:$git_repo_url@$git_ref"
136150node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git.json"
137151node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-git --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-inspect.json"
138-run_logged exec-git-plugin-cli bash -c 'node "$OPENCLAW_ENTRY" demo-git ping >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-cli.txt"'
152+run_plugins_shell_logged exec-git-plugin-cli 'node "$OPENCLAW_ENTRY" demo-git ping >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-cli.txt"'
139153140154node scripts/e2e/lib/plugins/assertions.mjs plugin-git "$git_repo_url" "$git_ref"
141155142-run_logged uninstall-git node "$OPENCLAW_ENTRY" plugins uninstall demo-plugin-git --force
156+run_plugins_openclaw_logged uninstall-git plugins uninstall demo-plugin-git --force
143157node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-uninstalled.json"
144158node scripts/e2e/lib/plugins/assertions.mjs plugin-git-removed
145159@@ -156,15 +170,15 @@ git -C "$git_update_repo" add -A
156170git -C "$git_update_repo" commit -qm "test fixture v1"
157171git_update_ref_v1="$(git -C "$git_update_repo" rev-parse HEAD)"
158172159-run_logged install-git-update node "$OPENCLAW_ENTRY" plugins install "git:$git_update_repo_url@main"
173+run_plugins_openclaw_logged install-git-update plugins install "git:$git_update_repo_url@main"
160174write_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"
161175git -C "$git_update_repo" add -A
162176git -C "$git_update_repo" commit -qm "test fixture v2"
163177164-node "$OPENCLAW_ENTRY" plugins update demo-plugin-git-update >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-update.log" 2>&1
178+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
165179node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-update.json"
166180node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-git-update --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-update-inspect.json"
167-run_logged exec-updated-git-plugin-cli bash -c 'node "$OPENCLAW_ENTRY" demo-git-update ping >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-update-cli.txt"'
181+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"'
168182169183node scripts/e2e/lib/plugins/assertions.mjs plugin-git-updated "$git_update_ref_v1"
170184@@ -185,7 +199,7 @@ echo "Testing plugin install visible after explicit restart..."
185199slash_install_dir="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-slash-install.XXXXXX")"
186200write_fixture_plugin "$slash_install_dir" slash-install-plugin 0.0.1 demo.slash.install "Slash Install Plugin"
187201188-run_logged install-slash-plugin node "$OPENCLAW_ENTRY" plugins install "$slash_install_dir"
202+run_plugins_openclaw_logged install-slash-plugin plugins install "$slash_install_dir"
189203node "$OPENCLAW_ENTRY" plugins inspect slash-install-plugin --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugin-command-install-show.json"
190204node scripts/e2e/lib/plugins/assertions.mjs slash-install
191205此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。