From 3286e99bc2b21a412b61e7e0a64ecbcf077c8e26 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 29 Apr 2026 01:17:15 +0100 Subject: [PATCH] refactor: share docker e2e instance helpers --- docs/reference/test.md | 2 +- scripts/e2e/cron-mcp-cleanup-docker.sh | 63 +++++++------------------ scripts/e2e/mcp-channels-docker.sh | 65 ++++++-------------------- scripts/lib/docker-e2e-package.sh | 2 +- scripts/lib/openclaw-e2e-instance.sh | 56 ++++++++++++++++++++++ 5 files changed, 89 insertions(+), 99 deletions(-) create mode 100644 scripts/lib/openclaw-e2e-instance.sh diff --git a/docs/reference/test.md b/docs/reference/test.md index 38bfe7a19a8..db52c06a23d 100644 --- a/docs/reference/test.md +++ b/docs/reference/test.md @@ -16,7 +16,7 @@ title: "Tests" - `pnpm check:changed`: runs the smart changed check gate for the diff against `origin/main`. It runs typecheck, lint, and guard commands for the affected architectural lanes, but does not run Vitest tests. Use `pnpm test:changed` or explicit `pnpm test ` for test proof. - `pnpm test`: routes explicit file/directory targets through scoped Vitest lanes. Untargeted runs use fixed shard groups and expand to leaf configs for local parallel execution; the extension group always expands to the per-extension shard configs instead of one giant root-project process. - Test wrapper runs end with a short `[test] passed|failed|skipped ... in ...` summary. Vitest's own duration line stays the per-shard detail. -- Shared OpenClaw test state: use `src/test-utils/openclaw-test-state.ts` from Vitest when a test needs an isolated `HOME`, `OPENCLAW_STATE_DIR`, `OPENCLAW_CONFIG_PATH`, config fixture, workspace, agent dir, or auth-profile store. For process-level E2E tests that need a running Gateway, use `test/helpers/openclaw-test-instance.ts` so state, config, CLI env, gateway startup, log capture, and cleanup stay together. Docker/Bash E2E lanes that source `scripts/lib/docker-e2e-image.sh` can pass `docker_e2e_test_state_shell_b64