fix(e2e): route focused docker smokes through run helper

This commit is contained in:
Vincent Koc
2026-05-26 11:23:29 +02:00
parent 21aebd5fbc
commit 4838e704a0
7 changed files with 23 additions and 6 deletions

View File

@@ -221,7 +221,7 @@ run_logged() {
}
echo "Running package Telegram live Docker E2E ($PACKAGE_LABEL)..."
run_logged docker run --rm \
run_logged docker_e2e_docker_run_cmd run --rm \
-e COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
-e OPENCLAW_NPM_TELEGRAM_INSTALL_SOURCE="$package_install_source" \
-e OPENCLAW_NPM_TELEGRAM_PACKAGE_LABEL="$PACKAGE_LABEL" \

View File

@@ -249,7 +249,7 @@ run_logged() {
}
echo "Installing ${PACKAGE_LABEL} from ${package_install_source}..."
run_logged docker run --rm \
run_logged docker_e2e_docker_run_cmd run --rm \
"${install_env[@]}" \
${package_mount_args[@]+"${package_mount_args[@]}"} \
-v "$npm_prefix_host:/npm-global" \
@@ -269,7 +269,7 @@ node -p "require('/npm-global/lib/node_modules/openclaw/package.json').version"
EOF
echo "Running package Telegram RTT Docker E2E ($PACKAGE_LABEL)..."
run_logged docker run --rm \
run_logged docker_e2e_docker_run_cmd run --rm \
"${docker_env[@]}" \
-v "$ROOT_DIR/scripts:/app/scripts:ro" \
-v "$ROOT_DIR/.artifacts:/app/.artifacts" \

View File

@@ -13,7 +13,7 @@ RUN_LOG="$(mktemp -t openclaw-plugin-binding-command-escape-log.XXXXXX)"
FOCUSED_TEST_REGEX="lets authorized plugin-owned binding commands fall through to command processing|keeps authorized unknown slash text in a plugin-owned binding routed to the bound plugin|keeps unauthorized plugin-owned binding slash text routed to the bound plugin"
cleanup() {
docker rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true
docker_e2e_docker_cmd rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true
rm -f "$RUN_LOG"
}
trap cleanup EXIT
@@ -26,7 +26,7 @@ docker_e2e_build_or_reuse \
echo "Running plugin binding command escape Docker E2E..."
set +e
docker run --rm \
docker_e2e_docker_run_cmd run --rm \
--name "$CONTAINER_NAME" \
-e COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
-e "FOCUSED_TEST_REGEX=$FOCUSED_TEST_REGEX" \

View File

@@ -3,6 +3,7 @@ set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
source "$ROOT_DIR/scripts/lib/docker-build.sh"
source "$ROOT_DIR/scripts/lib/docker-e2e-container.sh"
IMAGE_NAME="${OPENCLAW_QR_SMOKE_IMAGE:-openclaw-qr-smoke}"
DOCKER_BUILD_ARGS=()
@@ -22,4 +23,4 @@ docker_build_run qr-import-build \
"$ROOT_DIR"
echo "Running qrcode import smoke..."
run_logged qr-import-run docker run --rm -t "$IMAGE_NAME" node -e "import('qrcode').then(async (m)=>{const q=m.default??m;process.stdout.write(await q.toString('qr-smoke',{small:true,type:'terminal'}))})"
run_logged qr-import-run docker_e2e_docker_run_cmd run --rm -t "$IMAGE_NAME" node -e "import('qrcode').then(async (m)=>{const q=m.default??m;process.stdout.write(await q.toString('qr-smoke',{small:true,type:'terminal'}))})"

View File

@@ -32,6 +32,7 @@ const PLUGIN_BINDING_COMMAND_ESCAPE_DOCKER_E2E_PATH =
"scripts/e2e/plugin-binding-command-escape-docker.sh";
const PLUGIN_BINDING_COMMAND_ESCAPE_DOCKERFILE_PATH =
"scripts/e2e/plugin-binding-command-escape.Dockerfile";
const QR_IMPORT_DOCKER_E2E_PATH = "scripts/e2e/qr-import-docker.sh";
const MULTI_NODE_UPDATE_DOCKER_E2E_PATH = "scripts/e2e/multi-node-update-docker.sh";
const BUNDLED_PLUGIN_INSTALL_UNINSTALL_E2E_PATH =
"scripts/e2e/bundled-plugin-install-uninstall-docker.sh";
@@ -802,11 +803,22 @@ test -f "$TMPDIR/docker-cmd-seen"
expect(runner).toContain("--reporter=verbose -t");
expect(runner).not.toContain("-- --reporter=verbose");
expect(runner).toContain("docker_e2e_docker_run_cmd run --rm");
expect(runner).toContain('docker_e2e_docker_cmd rm -f "$CONTAINER_NAME"');
expect(runner).not.toMatch(/(^|\n)docker run --rm/u);
expect(runner).toContain("expected focused Vitest summary for exactly 3 passed tests");
expect(dockerfile).toContain("OPENCLAW_DISABLE_BUNDLED_PLUGIN_POSTINSTALL=1");
expect(dockerfile).toContain("pnpm install --frozen-lockfile --ignore-scripts --filter openclaw");
});
it("routes QR import Docker smoke through the timeout-aware run helper", () => {
const runner = readFileSync(QR_IMPORT_DOCKER_E2E_PATH, "utf8");
expect(runner).toContain("scripts/lib/docker-e2e-container.sh");
expect(runner).toContain("run_logged qr-import-run docker_e2e_docker_run_cmd run --rm -t");
expect(runner).not.toContain("run_logged qr-import-run docker run --rm");
});
it("covers plugin install/update sources in the Docker plugin sweep", () => {
const sweep = readFileSync(PLUGINS_DOCKER_SWEEP_PATH, "utf8");
const clawhub = readFileSync(PLUGINS_DOCKER_CLAWHUB_PATH, "utf8");

View File

@@ -43,6 +43,8 @@ describe("package Telegram live Docker E2E", () => {
expect(installRun).toContain('npm install -g "$install_source" --no-fund --no-audit');
expect(installRun).toContain('"${package_mount_args[@]}"');
expect(installRun).not.toContain('"${docker_env[@]}"');
expect(installRun).toContain("run_logged docker_e2e_docker_run_cmd run --rm");
expect(installRun).not.toContain("run_logged docker run --rm");
expect(script).toContain("run_logged docker_e2e_run_with_harness");
expect(script).toContain('"${docker_env[@]}"');
expect(script).toContain('if [ -z "$credential_role" ] && [ -n "${CI:-}" ]');

View File

@@ -143,6 +143,8 @@ describe("RTT harness", () => {
expect(installEnvSnapshotIndex).toBeGreaterThanOrEqual(0);
expect(convexSecretForwardIndex).toBeGreaterThan(installEnvSnapshotIndex);
expect(packageInstallIndex).toBeLessThan(credentialAcquireIndex);
expect(script).toContain("run_logged docker_e2e_docker_run_cmd run --rm");
expect(script).not.toContain("run_logged docker run --rm");
expect(heartbeatStartIndex).toBeGreaterThan(sourceIndex);
expect(heartbeatStartIndex).toBeLessThan(driverIndex);
expect(script).toContain("start_credential_heartbeat() {\n (\n set +e");