Skip to content

Refactor: split oversized test suites #106350

Description

@steipete

Summary

Split five oversized test suites into focused test-support modules while preserving one Vitest entry and mocked module graph per suite.

Problem

The OpenAI transport, configured reply dispatch, gateway agent methods, plugin loader, and policy doctor suites range from roughly 9,500 to 13,800 lines each. Their size makes navigation, ownership review, and focused maintenance unnecessarily difficult.

Proposed solution

  • Keep each existing *.test.ts path as the sole Vitest entry.
  • Move cohesive test groups into imported *.test-support.ts modules.
  • Extract only genuinely shared mocks and fixtures into *.test-harness.ts modules.
  • Preserve test registration titles and runtime ordering.

Alternatives considered

Independent *.test.ts fragments were rejected because the repository's non-isolated Vitest projects can reuse workers and mocked singleton state across files. A single entry importing support modules keeps the original module graph and execution semantics.

Impact

Test-only refactor. No runtime, user-facing, configuration, or dependency changes.

Metadata

Metadata

Assignees

Labels

P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.maintainerMaintainer-authored PR

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions