Skip to content

ci(test): aggregate coverage via Codecov #91

@JohnRDOrazio

Description

@JohnRDOrazio

Background

With #86 / #87 / #88 merged (closing #63), we now have three independent test runners producing coverage data:

  • Vitestlib/wordpress/* (Next.js data layer). Already supports npm run test:coverage (v8 provider).
  • PHPUnit + Brain Monkeycdcf-redis-translations plugin and cdcf-headless theme /cdcf/v1/* REST handlers.
  • bats-corescripts/cdcf_queue_worker.lib.sh queue-worker helpers.

Each runner is wired as a non-blocking CI check today (see workflows: `test-nextjs.yml`, `test-wordpress.yml`, `test-worker.yml`). There is no central place to view total coverage or see PR-level deltas.

Suggested scope

Phase 1 — Vitest + PHPUnit

  • Add Codecov upload step to `test-nextjs.yml` (lcov / json from v8 reporter)
  • Add Codecov upload step to `test-wordpress.yml` for both composer trees (clover from PHPUnit)
  • Add a top-level `codecov.yml` with non-blocking thresholds (matches the current "tests don't gate merges" posture). Suggested:
    • `coverage.status.project: informational: true`
    • `coverage.status.patch: informational: true`
    • Per-flag carryforward so a PR that only touches one tree doesn't reset the others
  • Use Codecov flags (`nextjs`, `wordpress-plugin`, `wordpress-theme`) so each tree is reported separately
  • Add a Codecov badge to README under the existing PR Build badge

Phase 2 — bats worker (later)

  • Wrap `scripts/tests/bats/bin/bats` with kcov to emit cobertura-compatible coverage
  • Add to `test-worker.yml` with the `worker` flag
  • Defer until Phase 1 is stable — kcov on Ubuntu runners is fiddlier than the Vitest/PHPUnit upload paths

Out of scope here

  • Making coverage gating mandatory (current policy: tests are non-blocking)
  • Coverage for components, E2E paths, or anything not already exercised by the existing suites

Why now

Three runners means three places to look. Codecov gives a single PR comment with per-flag deltas, which is the lightest-weight win available — no behavior change, just visibility. Free for public repos.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions