Repository navigation
refactor(test): compress repetitive fixtures in worst mega-tests with builders - #120055
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
August 6, 2026 22:56
Contributor
Author
|
Incident-mode landing note (operator-directed). GitHub's declared Actions incident prevented CI attachment and ClawSweeper review on this PR; the operator directed landing without waiting. Compensating gates, all satisfied:
Test LOC −1,332, production 0 (plus a new shared |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 7, 2026
… builders (openclaw#120055) * refactor(test): share incomplete-turn assistant fixtures * refactor(test): share realtime relay transport fixtures * refactor(test): share subagent registry fixtures * refactor(test): share CLI reliability fixtures * refactor(test): extract chat host fixture
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Five of the largest test files repeated dominant arrange objects dozens of times, obscuring the scenario-specific inputs and making fixture-wide updates risky. This refactor gives each scope one domain-named builder with Partial-based overrides, while preserving every test title, assertion, and runtime input.
Why This Change Was Made
run.incomplete-turn.test.ts: addsmakeLastAssistant; the canonicalmakeAttemptResultwas already present on this base and remains unchanged.talk-realtime-relay.test.ts: addsmakeRelayTransportwhile retaining the one deliberately method-absent fixture and preserving Vitest mock metadata.subagent-registry.test.ts: keeps the already-landed shared run builders and compresses the remaining killed-run, running-task, completed-collector, and suspended-delivery clusters.cli-runner.reliability.test.ts: adds builders for run exits, managed runs, Claude prepared contexts, and live Claude backends.chat-send.test.ts: extracts its existing mature host/request fixture intochat-host.test-fixture.ts; adoption is intentionally limited to this test file.Per-file physical LOC before → after:
src/agents/embedded-agent-runner/run.incomplete-turn.test.ts: 5,375 → 4,957src/gateway/talk-realtime-relay.test.ts: 4,269 → 4,039src/agents/subagent-registry.test.ts: 6,655 → 6,592src/agents/cli-runner.reliability.test.ts: 5,060 → 4,426ui/src/pages/chat/chat-send.test.ts: 9,240 → 9,058ui/src/pages/chat/chat-host.test-fixture.ts: 0 → 195User Impact
None. This is test-only fixture compression: no production code, behavior, public API, configuration, snapshots, inventories, or generated baselines changed.
Evidence
Focused Vitest counts are unchanged before → after:
node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run.incomplete-turn.test.ts: 171 → 171 passednode scripts/run-vitest.mjs src/gateway/talk-realtime-relay.test.ts: 63 → 63 passednode scripts/run-vitest.mjs src/agents/subagent-registry.test.ts: 143 → 143 passednode scripts/run-vitest.mjs src/agents/cli-runner.reliability.test.ts: 83 → 83 passednode scripts/run-vitest.mjs ui/src/pages/chat/chat-send.test.ts: 268 → 268 passedChecks:
pnpm format <six changed paths>: passednode scripts/run-oxlint.mjs <six changed paths>: passedgit diff --check: passedpnpm tsgo:ui: passedpnpm tsgo:core:test: changed fixture errors cleared; blocked only by three untouchedbrowser/serverglobal errors inui/src/e2e/appearance-settings-defaults.e2e.test.ts.agents/skills/autoreview/scripts/autoreview --mode local --stream-engine-output: clean, no accepted/actionable findingsnode scripts/check-changed.mjsdelegated as required but the provider chain failed before running: Blacksmith doctor failed, Daytona timed out, and Azure rejected the configured image selector withadmin_required. Its local fallback plan was run constituent-by-constituent; all guards, format, UI i18n, dead-code, dependency, boundary, and UI type lanes passed, with only the unrelated core-test diagnostics noted above.Production vs test LOC from
git diff origin/main...HEAD --numstat: