fix(test): mock pending state-dir relocation in Doctor e2e harness

Commit 5b3fd542e9 (#159965) made Doctor maintenance read the pending
state-dir migration resolver and preparation exports. The shared e2e
mock only provided autoMigrateLegacyStateDir, so maintenance refused
before the existing migration assertions could run.

Return null for pending relocation to match the harness's explicit
non-relocating state directory, and supply the preparation mock read
by the same destructuring import. The two other whole-module mocks
pass their owning tests unchanged.

CI failure: https://github.com/openclaw/openclaw/actions/runs/36408041411/job/108891152537
Before: 1 file, 2 failed / 4 passed, reproducing both missing-export failures.
After: 7 files / 65 tests passed, including all four harness consumers
(41 tests), both preflight mock owners (22 tests), and the registry
boundary test (2 tests). Single-worker wall time: 148.85s.

Proof used OPENCLAW_E2E_SKIP_BUILD=1 for source-based mocked-Gateway tests
after unrelated runtime-build preparation hit a service-lifecycle lock.
Scoped oxfmt, oxlint, the Doctor test typecheck lane, git diff --check,
and independent review through P2 passed. No production behavior change.
This commit is contained in:
Peter Steinberger 2026-09-28 04:08:59 -07:00
parent f9c8af7634
commit 162dea17b0

View file

@ -588,6 +588,8 @@ vi.mock("../infra/state-migrations.plugin-doctor.js", () => ({
vi.mock("../infra/state-migrations.state-dir.js", () => ({
autoMigrateLegacyStateDir,
resolvePendingLegacyStateDirMigrationPaths: vi.fn().mockReturnValue(null),
prepareLegacyStateDirMigration: vi.fn(),
}));
vi.mock("../infra/state-migrations.config-machine-state.js", () => ({