

















@@ -18,6 +18,12 @@ run_plugins_openclaw_logged() {
1818 run_logged "$label" openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" "$@"
1919}
202021+run_plugins_openclaw_capture() {
22+local output_file="$1"
23+shift
24+ openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" "$@" >"$output_file"
25+}
26+2127run_plugins_shell_logged() {
2228local label="$1"
2329shift
@@ -37,8 +43,8 @@ demo_plugin_root="$OPENCLAW_PLUGIN_HOME/$demo_plugin_id"
3743write_demo_fixture_plugin "$demo_plugin_root"
3844record_fixture_plugin_trust "$demo_plugin_id" "$demo_plugin_root" 1
394540-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins.json"
41-node "$OPENCLAW_ENTRY" plugins inspect demo-plugin --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-inspect.json"
46+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins.json" plugins list --json
47+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-inspect.json" plugins inspect demo-plugin --runtime --json
42484349node scripts/e2e/lib/plugins/assertions.mjs demo-plugin
4450@@ -47,58 +53,58 @@ pack_dir="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-pack.XXXXXX")"
4753pack_fixture_plugin "$pack_dir" "$OPENCLAW_PLUGINS_TMP_DIR/demo-plugin-tgz.tgz" demo-plugin-tgz 0.0.1 demo.tgz "Demo Plugin TGZ"
48544955run_plugins_openclaw_logged install-tgz plugins install "$OPENCLAW_PLUGINS_TMP_DIR/demo-plugin-tgz.tgz"
50-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins2.json"
51-node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-tgz --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins2-inspect.json"
56+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins2.json" plugins list --json
57+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins2-inspect.json" plugins inspect demo-plugin-tgz --runtime --json
52585359node scripts/e2e/lib/plugins/assertions.mjs plugin-tgz
54605561run_plugins_openclaw_logged uninstall-tgz plugins uninstall demo-plugin-tgz --force
56-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins2-uninstalled.json"
62+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins2-uninstalled.json" plugins list --json
5763node scripts/e2e/lib/plugins/assertions.mjs plugin-tgz-removed
58645965echo "Testing install from local folder (plugins.load.paths)..."
6066dir_plugin="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-dir.XXXXXX")"
6167write_fixture_plugin "$dir_plugin" demo-plugin-dir 0.0.1 demo.dir "Demo Plugin DIR"
62686369run_plugins_openclaw_logged install-dir plugins install "$dir_plugin"
64-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins3.json"
65-node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-dir --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins3-inspect.json"
70+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins3.json" plugins list --json
71+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins3-inspect.json" plugins inspect demo-plugin-dir --runtime --json
66726773node scripts/e2e/lib/plugins/assertions.mjs plugin-dir "$dir_plugin"
68746975openclaw_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
7076node scripts/e2e/lib/plugins/assertions.mjs plugin-dir-update-skipped
71777278run_plugins_openclaw_logged uninstall-dir plugins uninstall demo-plugin-dir --force
73-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins3-uninstalled.json"
79+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins3-uninstalled.json" plugins list --json
7480node scripts/e2e/lib/plugins/assertions.mjs plugin-dir-removed
75817682echo "Testing install from local folder with preinstalled dependencies..."
7783dir_deps_plugin="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-dir-deps.XXXXXX")"
7884write_fixture_plugin_with_vendored_dependency "$dir_deps_plugin" demo-plugin-dir-deps 0.0.1 demo.dir.deps "Demo Plugin DIR Deps"
79858086run_plugins_openclaw_logged install-dir-deps plugins install "$dir_deps_plugin"
81-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-deps.json"
82-node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-dir-deps --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-deps-inspect.json"
87+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-deps.json" plugins list --json
88+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-deps-inspect.json" plugins inspect demo-plugin-dir-deps --runtime --json
83898490node scripts/e2e/lib/plugins/assertions.mjs plugin-dir-deps "$dir_deps_plugin"
85918692run_plugins_openclaw_logged uninstall-dir-deps plugins uninstall demo-plugin-dir-deps --force
87-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-deps-uninstalled.json"
93+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-dir-deps-uninstalled.json" plugins list --json
8894node scripts/e2e/lib/plugins/assertions.mjs plugin-dir-deps-removed
89959096echo "Testing install from npm spec (file:)..."
9197file_pack_dir="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-filepack.XXXXXX")"
9298write_fixture_plugin "$file_pack_dir/package" demo-plugin-file 0.0.1 demo.file "Demo Plugin FILE"
939994100run_plugins_openclaw_logged install-file plugins install "file:$file_pack_dir/package"
95-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins4.json"
96-node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-file --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins4-inspect.json"
101+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins4.json" plugins list --json
102+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins4-inspect.json" plugins inspect demo-plugin-file --runtime --json
9710398104node scripts/e2e/lib/plugins/assertions.mjs plugin-file "$file_pack_dir/package"
99105100106run_plugins_openclaw_logged uninstall-file plugins uninstall demo-plugin-file --force
101-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins4-uninstalled.json"
107+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins4-uninstalled.json" plugins list --json
102108node scripts/e2e/lib/plugins/assertions.mjs plugin-file-removed
103109104110echo "Testing install and update from npm registry..."
@@ -112,8 +118,8 @@ pack_fixture_plugin_with_invalid_extension_entry "$invalid_npm_pack_dir" "$OPENC
112118start_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"
113119114120run_plugins_openclaw_logged install-npm plugins install "npm:@openclaw/demo-plugin-npm@0.0.1"
115-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm.json"
116-node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-npm --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-inspect.json"
121+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm.json" plugins list --json
122+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-inspect.json" plugins inspect demo-plugin-npm --runtime --json
117123run_plugins_shell_logged exec-npm-plugin-cli 'node "$OPENCLAW_ENTRY" demo-npm ping >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-cli.txt"'
118124119125node scripts/e2e/lib/plugins/assertions.mjs plugin-npm
@@ -122,7 +128,7 @@ openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" node "$OPENCLAW_ENTRY
122128node scripts/e2e/lib/plugins/assertions.mjs plugin-npm-update
123129124130run_plugins_openclaw_logged uninstall-npm plugins uninstall demo-plugin-npm --force
125-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-uninstalled.json"
131+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-npm-uninstalled.json" plugins list --json
126132node scripts/e2e/lib/plugins/assertions.mjs plugin-npm-removed
127133128134echo "Testing npm install rejects malformed package metadata..."
@@ -131,7 +137,7 @@ if openclaw_e2e_maybe_timeout "$OPENCLAW_PLUGINS_CLI_TIMEOUT" node "$OPENCLAW_EN
131137echo "Expected malformed package metadata install to fail." >&2
132138exit 1
133139fi
134-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-invalid-openclaw-extensions-list.json"
140+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-invalid-openclaw-extensions-list.json" plugins list --json
135141node scripts/e2e/lib/plugins/assertions.mjs invalid-openclaw-extensions
136142137143echo "Testing install from git repo and plugin CLI execution..."
@@ -147,14 +153,14 @@ git -C "$git_repo" commit -qm "test fixture"
147153git_ref="$(git -C "$git_repo" rev-parse HEAD)"
148154149155run_plugins_openclaw_logged install-git plugins install "git:$git_repo_url@$git_ref"
150-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git.json"
151-node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-git --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-inspect.json"
156+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-git.json" plugins list --json
157+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-inspect.json" plugins inspect demo-plugin-git --runtime --json
152158run_plugins_shell_logged exec-git-plugin-cli 'node "$OPENCLAW_ENTRY" demo-git ping >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-cli.txt"'
153159154160node scripts/e2e/lib/plugins/assertions.mjs plugin-git "$git_repo_url" "$git_ref"
155161156162run_plugins_openclaw_logged uninstall-git plugins uninstall demo-plugin-git --force
157-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-uninstalled.json"
163+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-uninstalled.json" plugins list --json
158164node scripts/e2e/lib/plugins/assertions.mjs plugin-git-removed
159165160166echo "Testing git plugin update from moving ref..."
@@ -176,8 +182,8 @@ git -C "$git_update_repo" add -A
176182git -C "$git_update_repo" commit -qm "test fixture v2"
177183178184openclaw_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
179-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-update.json"
180-node "$OPENCLAW_ENTRY" plugins inspect demo-plugin-git-update --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-update-inspect.json"
185+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-update.json" plugins list --json
186+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-update-inspect.json" plugins inspect demo-plugin-git-update --runtime --json
181187run_plugins_shell_logged exec-updated-git-plugin-cli 'node "$OPENCLAW_ENTRY" demo-git-update ping >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-git-update-cli.txt"'
182188183189node scripts/e2e/lib/plugins/assertions.mjs plugin-git-updated "$git_update_ref_v1"
@@ -188,19 +194,19 @@ bundle_root="$OPENCLAW_PLUGIN_HOME/$bundle_plugin_id"
188194write_claude_bundle_fixture "$bundle_root"
189195record_fixture_plugin_trust "$bundle_plugin_id" "$bundle_root" 0
190196191-node "$OPENCLAW_ENTRY" plugins list --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-bundle-disabled.json"
197+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-bundle-disabled.json" plugins list --json
192198node scripts/e2e/lib/plugins/assertions.mjs bundle-disabled
193199194-run_logged enable-claude-bundle node "$OPENCLAW_ENTRY" plugins enable claude-bundle-e2e
195-node "$OPENCLAW_ENTRY" plugins inspect claude-bundle-e2e --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugins-bundle-inspect.json"
200+run_plugins_openclaw_logged enable-claude-bundle plugins enable claude-bundle-e2e
201+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-bundle-inspect.json" plugins inspect claude-bundle-e2e --json
196202node scripts/e2e/lib/plugins/assertions.mjs bundle-inspect
197203198204echo "Testing plugin install visible after explicit restart..."
199205slash_install_dir="$(mktemp -d "$OPENCLAW_PLUGINS_TMP_DIR/openclaw-plugin-slash-install.XXXXXX")"
200206write_fixture_plugin "$slash_install_dir" slash-install-plugin 0.0.1 demo.slash.install "Slash Install Plugin"
201207202208run_plugins_openclaw_logged install-slash-plugin plugins install "$slash_install_dir"
203-node "$OPENCLAW_ENTRY" plugins inspect slash-install-plugin --runtime --json >"$OPENCLAW_PLUGINS_TMP_DIR/plugin-command-install-show.json"
209+run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugin-command-install-show.json" plugins inspect slash-install-plugin --runtime --json
204210node scripts/e2e/lib/plugins/assertions.mjs slash-install
205211206212run_plugins_marketplace_scenario
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。