Skip to content

Test hygiene: make root src/__tests__/ CI-able (pollution + infra deps), then widen the CI Test scope #304

Description

@TerrysPOV

Context

CI now runs bun test on the clean module suites (src/bus, src/tuner, src/observability, src/skills-tuner, src/governance — ~700 tests, all green) via the new Test workflow. The root src/__tests__/ suite is excluded because a full bun test on main is 2518 pass / 41 fail, and all 41 failures live in src/__tests__/.

The 41 failures split two ways

  1. Cross-test pollution — tests that pass in isolation but fail in the shared process (e.g. Phase 18: runner modelOverride wiring passes alone, fails in the pack). Root cause is shared module/singleton/env/file state between test files. This is the same class the SDC mark-tests-passing.sh works around with TEST_ARGS scoping.
  2. Infra-dependent — tests that fail even in isolation because they need a DB/queue/service not present in CI (e.g. Event Processor → 9 fail alone).

Representative failing files: event-processor, jobs, escalation/*, gateway/*, policy/*, mcp_proxy_*, pty-*, runner, integration/*.

Goal

Make src/__tests__/ green (fix pollution via proper per-test isolation/teardown; gate or mock the infra-dependent tests), then widen the CI Test job's paths toward the full bun test. Landmark: CI runs the whole suite green.

Why it matters

The reason this surfaced: PR #290's 3 hanging collectObservations tests showed green in CI because CI ran no tests at all. The scoped Test job catches that class in the module dirs now; closing this issue extends the safety net to the whole codebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions