Skip to content

QUALITY: Test-suite coverage gaps and schema drift #62

Description

@echel0nn

Labels: quality, tests
Severity: S2. The suite gives false confidence on the exact paths this sweep found broken.

Finding (path:line) Issue
tests/platform/conftest.py:36 (12+ fixtures) Tables built via SQLModel.metadata.create_all instead of running Alembic -> the schema under test can diverge from the migrated production schema (missing constraints/indexes/column types); tests pass on code that would fail on a real DB
tests/test_knowledge_hybrid_retrieve.py:13 Whole file pytest.mark.skip(reason='SQLite-era tests') -> 4+ knowledge-retrieval tests never run (false coverage)
tests/modules/vulnerability/workflow/test_two_phase_dispatch.py:188,204 Two dispatch tests permanently skipped pending a fixture never built -> two-phase dispatch has zero automated coverage
tests/platform/llm/test_client.py:310,336 Retry tests mock asyncio.sleep but never assert retry count or backoff intervals -> retry logic could lose its backoff silently without failing

Highest-value missing tests:

  1. PersistContract.upsert/upsert_many (conflict path, no-natural-key path, None-id exclusion) -- zero tests.
  2. ObligationSet/adjudicate() platform contracts -- zero unit tests (only implicit via nday).
  3. RunState/PlatformResponse/RouteDecision JSON round-trip / model_dump(mode='json').
  4. ReasoningCaseState.observables non-serializable-value rejection before the task queue.
  5. Team isolation at the register_team_scope_listener() ORM hook in isolation (API tests pass even if the hook is disabled).
  6. Workflow crash -> /re-enqueue recovery (cursor wipe + re-submit), the bridge between stuck and recovered.

Acceptance: fixtures run Alembic (or a documented parity check); no permanently-skipped test files (delete or fix); retry tests assert count + backoff; the six missing tests added, prioritizing the team-scope hook and serialization guards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions