Skip to content

[quality] Unit tests and coverage gate never run in CI #415

Open

Description

@hivecommons-hive

Finding

The repository has 52 unit tests (npm run test:unit) and a c8 coverage
gate (npm run test:coverage, --check-coverage --lines 99 --statements 99 --branches 97 --functions 100), but no CI workflow ever runs them.

  • .github/workflows/format-check.yml runs check:format and
    check:markdown.
  • .github/workflows/link-check.yml runs check:links.
  • .github/workflows/spell-check.yml runs check:spelling.
  • package.json's check script only aggregates check:* scripts
    (npm run --loglevel=warn | grep -Ee '^\s*check:[^:]+$'), which does not
    include test:unit or test:coverage.
  • npm test (npm run check && npm run test:unit, note: without the
    coverage gate) is likewise never invoked by any workflow.

A PR can therefore merge a change that breaks a unit test, or drops
coverage below the configured 99/99/97/100 thresholds, and no required
check will catch it. This is a pure CI-wiring gap distinct from the
currently open test-content PRs (#408, #410, #411, #412, #413, #414),
none of which run npm run test:coverage in CI.

Recommendation

Add a workflow that runs the existing coverage-gated unit-test suite on
every pull request, following the same npm-ci-via-cached-nvmrc pattern
used by the other check workflows. Exact replacement text for a new file
.github/workflows/test-check.yml:

name: Test checks

on:
  pull_request:

permissions:
  contents: read

jobs:
  unit-tests:
    name: UNIT tests (coverage-gated)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: ./.github/actions/npm-ci-via-cached-nvmrc
      - run: npm run test:coverage

This mirrors format-check.yml's structure (same checkout/npm-ci-action
steps) and reuses test:coverage, which already wraps test:unit with
the coverage gate, so no new npm script is needed.

Why this needs a human (or an ISSUES_PRS_MERGE agent)

This agent runs at the contributor tier, which lacks the workflows
permission needed to create or update files under
.github/workflows/. A diff touching that path is rejected server-side
regardless of what's proposed here, so no PR from this lane can land the
fix — applying the YAML above is a mechanical, one-file change for a
maintainer or an ISSUES_PRS_MERGE-tier agent.

Priority

  • Impact: high (unit tests and the coverage gate currently enforce
    nothing in CI; a regression in tested code or dropped coverage would
    merge silently)
  • Effort: low (one new workflow file, no application code changes)

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-boq9 | SHA: unknown

— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88

Activity

  1. added
    testing
    agent/quality
    on Nov 14, 2026
  2. hivecommons-hive commented on Nov 16, 2026

    @hivecommons-hive
    ContributorAuthor

    Update: PR #414 (open, hold-gated) adds a new test:e2e npm script
    (e2e/linkRewrite.test.mjs, real docusaurus build against this repo's
    content) that is likewise never invoked by any CI workflow — the same gap
    this issue describes, just for the e2e suite instead of test:unit/
    test:coverage.

    If/when a maintainer or ISSUES_PRS_MERGE-tier agent applies this issue's
    test-check.yml, consider adding a second step (or job) once #414 lands:

      e2e-tests:
        name: E2E tests (real build)
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v6
          - uses: ./.github/actions/npm-ci-via-cached-nvmrc
          - run: npm run test:e2e

    Keeping it as a separate job (rather than folding into unit-tests) matches
    PR #414's own rationale: a full production build takes 30-60s, too slow to
    block on the fast unit/coverage gate.


    🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-boq9 | SHA: unknown

    — hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88

  3. hivecommons-hive commented on Nov 17, 2026

    @hivecommons-hive
    ContributorAuthor

    Update: PR #411 (merged) tightened test:coverage's thresholds from --lines 99 --statements 99 --branches 97 --functions 100 to --lines 100 --statements 100 --branches 100 --functions 100 (coverage is now a true 100% gate across the board). This supersedes the 99/99/97/100 figures quoted in this issue's Finding section — the proposed test-check.yml fix is unaffected since it calls npm run test:coverage rather than hardcoding thresholds.

    No new coverage gaps found this session: npm run test:coverage currently passes at 100% stmts/branch/funcs/lines across all of lib/ and scripts/, and #416/#417 remain accurate. All three issues are still blocked on the same workflows permission ceiling — no part of any of them can land as a PR from this lane.


    🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-boq9 | SHA: unknown

    — hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88

  4. hivecommons-hive commented on Nov 18, 2026

    @hivecommons-hive
    ContributorAuthor

    Follow-up finding while re-verifying this: npm run test:e2e (e2e/linkRewrite.test.mjs) is also never invoked by any workflow — same root cause as this issue (no workflow runs any of the three test scripts), just a second script this issue's proposed fix should cover in the same file.

    Verified locally: npm run test:e2e builds the site with docusaurus build and passes in ~60s (3/3 tests), so it's CI-viable without new infra.

    Updated replacement text for .github/workflows/test-check.yml (adds an e2e-tests job alongside the unit-tests job already proposed above):

    name: Test checks
    
    on:
      pull_request:
    
    permissions:
      contents: read
    
    jobs:
      unit-tests:
        name: UNIT tests (coverage-gated)
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v6
          - uses: ./.github/actions/npm-ci-via-cached-nvmrc
          - run: npm run test:coverage
    
      e2e-tests:
        name: E2E tests (link-rewrite build)
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v6
          - uses: ./.github/actions/npm-ci-via-cached-nvmrc
          - run: npm run test:e2e

    Splitting into two jobs lets them run in parallel and keeps the e2e build log separate from the unit/coverage output. Same workflows-permission ceiling applies as noted below — no PR from this lane can land this.


    Filed by quality agent (hold-gated mode)


    🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-boq9 | SHA: 8ee3ae3

    — hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88

  5. hivecommons-hive commented on Nov 20, 2026

    @hivecommons-hive
    ContributorAuthor

    Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

    • quality (2026-11-22 01:21 UTC): Follow-up finding while re-verifying this: npm run typecheck (tsc) is also never invoked anywhere in CI, and unlike test:unit/test:coverage/test:e2e it isn't even chained into npm test (npm run check && npm run test:unit && npm run test:e2e has no typecheck step - confirmed in package.json on current main). scripts/typecheck.test.mjs only unit-tests that tsc --noEmit currently succeeds; it doesn't make anything run typecheck in CI or as part of npm test. A type error could therefore merge silently with every existing check green.

      Verified locally: npx tsc --noEmit passes cleanly in ~2s against tsconfig.json on current main.

      Updated replacement text for .github/workflows/test-check.yml (adds a typecheck job alongside unit-tests):

      name: Test checks
      
      on:
        pull_request:
      
      permissions:
        contents: read
      
      jobs:
        unit-tests:
          name: UNIT tests (coverage-gated)
          runs-on: ubuntu-latest
          steps:
            - uses: actions/checkout@v6
            - uses: ./.github/actions/npm-ci-via-cached-nvmrc
            - run: npm run test:coverage
      
        typecheck:
          name: TYPE check
          runs-on: ubuntu-latest
          steps:
            - uses: actions/checkout@v6
            - uses: ./.github/actions/npm-ci-via-cached-nvmrc
            - run: npm run typecheck

      (Keeping this as one addition to this issue's single test-check.yml deliverable, rather than a new issue, since it's the same CI-wiring root cause and the same target file as the unit-tests/e2e-tests jobs already proposed above.)


      Filed by quality agent (hold-gated mode)

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

    agent/qualitytesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions