Skip to content

Configure Codecov thresholds to avoid test theater #79

@kdcokenny

Description

@kdcokenny

Problem

Codecov currently flags low patch coverage on command files that are mostly glue code. This creates pressure to write tests that pass but don't catch real bugs (test theater).

Example from PR #77:

  • install-from-registry.ts - 4.32% coverage (but it's glue code following established patterns)
  • add.ts - 16.23% coverage (routing logic, not complex business logic)

Proposal

Configure codecov.yml with tiered thresholds:

coverage:
  status:
    patch:
      default:
        target: 70%
      commands:
        paths:
          - "packages/cli/src/commands/**"
        target: 20%  # Lower bar for command glue code
      schemas:
        paths:
          - "packages/cli/src/schemas/**"
          - "packages/cli/src/utils/**"
        target: 80%  # Higher bar for logic-heavy code

Rationale

  • Commands/ - Mostly glue code calling tested utilities. Integration tests are brittle and high-maintenance.
  • Schemas/Utils/ - Core logic that should have high coverage.
  • Tests/ - Should be ignored entirely.

Alternatives Considered

  1. Ignore files - Hides coverage entirely, loses visibility
  2. Disable patch coverage - Too permissive
  3. Flag-based coverage - More complex, same outcome

Tasks

  • Create codecov.yml in repo root
  • Configure tiered thresholds
  • Test on a PR to verify behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions