Skip to content

fix(ci): review-enrichment's real node:test coverage is invisible to Codecov (83 of 83 files effectively unmeasured) #6250

Description

@JSONbored

Context

review-enrichment/ (@loopover/rees, 83 .ts files under src/) is a standalone service — deliberately not an npm workspace member (its own package.json/package-lock.json), deployed independently on Railway. Its real test suite runs via Node's own test runner ("test:node": "node --test --experimental-strip-types \"test/**/*.test.ts\""), wired into CI via npm run rees:test (part of the root test:ci pipeline, .github/workflows/ci.yml). Tests genuinely run and — as far as CI green/red goes — pass.

But Codecov never sees any of it: the root vitest.config.ts's coverage.include array lists exactly one file from this entire package — review-enrichment/src/analyzers/codeowners.ts — out of 83. And even that single file isn't imported anywhere in the root src/** or test/** trees (confirmed via repo-wide grep for analyzers/codeowners), meaning nothing vitest runs actually exercises it either — the one "included" file is realistically also unmeasured. Net effect: this entire 83-file package, including a secret-scanning analyzer (secret-scan.ts), shows as completely uncovered in Codecov, even though real tests for it exist and run in CI.

This is the same failure mode as a previously-hit issue in this repo where a node:test-based suite's real coverage was invisible to Codecov because nothing bridged it into the vitest/lcov pipeline that Codecov actually reads.

Requirements

  • Confirm exactly which of review-enrichment/test/**/*.test.ts currently pass in CI (they should — this is a visibility gap, not (necessarily) a real test-coverage gap) before assuming zero tests exist.
  • Wire review-enrichment's real coverage into a form Codecov can ingest. The two realistic approaches, in likely order of preference given review-enrichment's deliberate standalone-deployability (do not force it into the root npm workspace or vitest runner as a side effect of this fix):
    1. Run node --test --experimental-test-coverage (Node 20+ supports this) with an LCOV-producing reporter, and upload that as a separate Codecov flag alongside the existing vitest upload, so Codecov merges both into one project view and — critically — applies patch-coverage gating to review-enrichment/** changes too.
    2. If Node's native coverage output can't produce a Codecov-compatible format cleanly, investigate c8/v8 coverage collection wrapping node --test instead.
  • Remove or fix the single stale review-enrichment/src/analyzers/codeowners.ts entry in vitest.config.ts's coverage.include — it doesn't reflect reality either way (nothing vitest runs imports it).
  • Update codecov.yml if a second upload flag is introduced, so patch-coverage gating actually applies to review-enrichment/** PRs (today, a review-enrichment-only PR likely gets a green/no-op Codecov check regardless of what it changes, since none of its lines are in any tracked report — confirm this is really happening today as part of this issue's own verification).

Test Coverage Requirements

This issue's own success criterion IS improved coverage visibility — after this lands, a PR touching review-enrichment/src/** should show real, non-zero patch coverage in its Codecov check, and a deliberately-added untested branch in that package should cause a real patch-coverage failure (verify this as part of the PR, e.g. with a temporary throwaway branch during testing, not left in the final diff).

Deliverables

  • review-enrichment's real node --test coverage is captured and uploaded to Codecov.
  • vitest.config.ts's stale/misleading single-file coverage.include entry for review-enrichment is corrected.
  • Verified: a PR touching only review-enrichment/src/** now gets a real, non-trivial Codecov patch-coverage check instead of an effectively-vacuous one.

Expected Outcome

review-enrichment's genuine test coverage (which already exists and runs in CI) becomes visible to Codecov, closing a blind spot where a real regression in an 83-file package — including its secret-scanning analyzer — could currently ship without the coverage gate ever seeing it.

Links & Resources

  • review-enrichment/package.json (test, test:node scripts)
  • vitest.config.ts (coverage.include, currently lists one stale/unexercised file)
  • .github/workflows/ci.yml:330-353 (how rees:test already runs in CI today)
  • review-enrichment/test/ (the real, already-passing test suite this makes visible)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.gittensor:priorityMaintainer-selected Gittensor priority — scores a 1.5x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions