Skip to content

Add proper test coverage measurement (90%+ target) #1

Closed

Description

@neuromechanist

Problem

Current CLI tests spawn subprocesses which aren't instrumented for coverage tracking. We cannot accurately measure code coverage to ensure we meet our 90%+ target.

Current State

  • 47 integration tests (29 API + 18 CLI)
  • All tests passing on CI
  • Coverage measurement only works for directly imported code, not subprocess CLI invocations

Proposed Solution

  1. Unit tests for core modules: Add unit tests that directly import and test:

    • src/lib/config.ts
    • src/lib/api.ts
    • src/commands/auth.ts
    • src/commands/admin.ts
    • src/commands/dataset.ts
  2. Coverage tooling: Configure Bun coverage to track all source files:

    [test]
    coverage = true
    coverageThreshold = { line = 90, function = 90 }
  3. CI integration: Add coverage reporting to GitHub Actions workflow

Acceptance Criteria

  • Unit tests for all core modules
  • Coverage report generated on each CI run
  • 90%+ line and function coverage achieved
  • Coverage badge in README

Notes

Integration tests (current) verify end-to-end behavior; unit tests (proposed) will enable coverage tracking.

Activity

  1. added 2 commits that reference this issue on May 28, 2026
  2. added
    P3
    testing
    on Jun 18, 2026
  3. neuromechanist commented on Sep 3, 2026

    @neuromechanist
    ContributorAuthor

    Closing as superseded. The project moved to entry-point testing (.rules/testing.md, "Test the entry point, not the piece") and never adopted a coverage percentage gate; the subprocess-spawned CLI tests would not be instrumented by bun --coverage anyway. There are 288 test files today versus 47 when this was filed. Reopen if a coverage gate becomes a release requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions