Skip to content

Commit dfa1a51

Browse files
committed
fix(test): focus plugin binding Docker smoke
1 parent a4fab83 commit dfa1a51

4 files changed

Lines changed: 38 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Docs: https://docs.openclaw.ai
1010

1111
- Channels/iMessage: advance the startup catchup cursor from live-handled rows after a completed catchup pass, including rows received while catchup is still running, so restarts do not replay them. (#85475) Thanks @TurboTheTurtle.
1212
- Tests: mount the shared Windows command helper into bare Docker E2E harness containers so published upgrade-survivor config walks can start on Linux.
13+
- Tests: keep the plugin binding command escape Docker smoke focused on its intended Vitest cases and skip source-only install lifecycle scripts.
1314
- Tests: let the generic plugin install E2E assertions use a configurable temp root and Windows home-relative install paths.
1415
- Tests: keep kitchen-sink plugin assertion fixtures on a configurable temp root so native Windows runs no longer skip full-surface diagnostic coverage.
1516
- Tests: fail Gateway startup benchmarks when a child startup never produces ready probes or process metrics instead of reporting all `n/a` samples as passing.

scripts/e2e/plugin-binding-command-escape-docker.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ docker run --rm \
3232
-e "FOCUSED_TEST_REGEX=$FOCUSED_TEST_REGEX" \
3333
-e OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/tmp/openclaw-vitest-cache \
3434
"$IMAGE_NAME" \
35-
bash -lc 'set -euo pipefail; corepack enable; node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts -- --reporter=verbose -t "$FOCUSED_TEST_REGEX"' \
35+
bash -lc 'set -euo pipefail; corepack enable; node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts --reporter=verbose -t "$FOCUSED_TEST_REGEX"' \
3636
>"$RUN_LOG" 2>&1
3737
status=$?
3838
set -e
@@ -43,4 +43,23 @@ if [ "$status" -ne 0 ]; then
4343
exit "$status"
4444
fi
4545

46-
echo "OK"
46+
if ! node - "$RUN_LOG" <<'NODE'
47+
const fs = require("node:fs");
48+
const logPath = process.argv[2];
49+
const text = fs
50+
.readFileSync(logPath, "utf8")
51+
.replace(/\x1B\[[0-?]*[ -/]*[@-~]/gu, "");
52+
53+
if (!/(?:^|\n)\s*Tests\s+3 passed\b/u.test(text)) {
54+
console.error("expected focused Vitest summary for exactly 3 passed tests");
55+
console.error(text.slice(-4000));
56+
process.exit(1);
57+
}
58+
NODE
59+
then
60+
echo "Docker plugin binding command escape smoke did not stay focused"
61+
cat "$RUN_LOG"
62+
exit 1
63+
fi
64+
65+
echo "OK (3 focused tests)"

scripts/e2e/plugin-binding-command-escape.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ RUN corepack enable
99
WORKDIR /workspace/openclaw
1010
COPY . .
1111

12-
RUN pnpm install --frozen-lockfile
12+
RUN OPENCLAW_DISABLE_BUNDLED_PLUGIN_POSTINSTALL=1 pnpm install --frozen-lockfile --ignore-scripts --filter openclaw
1313

1414
CMD ["bash"]

test/scripts/docker-build-helper.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ const OPENAI_WEB_SEARCH_MINIMAL_SCENARIO_PATH =
1818
const OPENAI_WEB_SEARCH_MINIMAL_CLIENT_PATH =
1919
"scripts/e2e/lib/openai-web-search-minimal/client.mjs";
2020
const OPENWEBUI_DOCKER_E2E_PATH = "scripts/e2e/openwebui-docker.sh";
21+
const PLUGIN_BINDING_COMMAND_ESCAPE_DOCKER_E2E_PATH =
22+
"scripts/e2e/plugin-binding-command-escape-docker.sh";
23+
const PLUGIN_BINDING_COMMAND_ESCAPE_DOCKERFILE_PATH =
24+
"scripts/e2e/plugin-binding-command-escape.Dockerfile";
2125
const BUNDLED_PLUGIN_INSTALL_UNINSTALL_E2E_PATH =
2226
"scripts/e2e/bundled-plugin-install-uninstall-docker.sh";
2327
const BUNDLED_PLUGIN_INSTALL_UNINSTALL_SWEEP_PATH =
@@ -383,6 +387,17 @@ describe("docker build helper", () => {
383387
expect(clawhub).toContain("unset OPENCLAW_CLAWHUB_URL CLAWHUB_URL");
384388
});
385389

390+
it("keeps the plugin binding command escape Docker smoke focused", () => {
391+
const runner = readFileSync(PLUGIN_BINDING_COMMAND_ESCAPE_DOCKER_E2E_PATH, "utf8");
392+
const dockerfile = readFileSync(PLUGIN_BINDING_COMMAND_ESCAPE_DOCKERFILE_PATH, "utf8");
393+
394+
expect(runner).toContain("--reporter=verbose -t");
395+
expect(runner).not.toContain("-- --reporter=verbose");
396+
expect(runner).toContain("expected focused Vitest summary for exactly 3 passed tests");
397+
expect(dockerfile).toContain("OPENCLAW_DISABLE_BUNDLED_PLUGIN_POSTINSTALL=1");
398+
expect(dockerfile).toContain("pnpm install --frozen-lockfile --ignore-scripts --filter openclaw");
399+
});
400+
386401
it("covers plugin install/update sources in the Docker plugin sweep", () => {
387402
const sweep = readFileSync(PLUGINS_DOCKER_SWEEP_PATH, "utf8");
388403
const clawhub = readFileSync(PLUGINS_DOCKER_CLAWHUB_PATH, "utf8");

0 commit comments

Comments
 (0)