Skip to content

test: Add tests for critical untested source files #54

@dean0x

Description

@dean0x

Problem

Several critical source files have no test coverage. These are core infrastructure components that would benefit from behavioral tests before public launch.

Scope

Tier 1 — Launch priority (complex, high-risk)

File Lines Why
task-manager.ts 510 Orchestrates entire task lifecycle
event-driven-worker-pool.ts 520 Worker pool with autoscaling
worktree-manager.ts 691 Git worktree isolation

Tier 2 — Important (medium complexity)

File Lines Why
autoscaling-manager.ts 342 Dynamic worker scaling
resource-monitor.ts 445 System resource monitoring
recovery-manager.ts Error recovery logic
container.ts DI container

Tier 3 — Post-launch (lower risk)

  • Utils, output-repository, github-integration, logger

Testing Approach

  • Follow existing patterns: mock dependencies, test behaviors not implementation
  • Use MockWorkerPool, MockProcessSpawner patterns from existing tests
  • Focus on: happy paths, error paths, edge cases, event emissions
  • Each test file should be added to the appropriate test group in package.json

Cross-Reference

Issue #31 items that may overlap:

  • Timing-based test waits (addressed in some files)
  • QueryHandler workaround
  • findByStatus pagination

These should be addressed opportunistically during this work.

Acceptance Criteria

  • Tier 1 files have >80% branch coverage
  • Tier 2 files have >60% branch coverage
  • Tests follow existing patterns (mocks, behavioral testing)
  • All new tests are in appropriate test groups
  • No timing-based waits in new tests

Dependencies

  • Depends on Biome setup (new tests should conform to lint rules from day 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions