Background
With #86 / #87 / #88 merged (closing #63), we now have three independent test runners producing coverage data:
- Vitest —
lib/wordpress/* (Next.js data layer). Already supports npm run test:coverage (v8 provider).
- PHPUnit + Brain Monkey —
cdcf-redis-translations plugin and cdcf-headless theme /cdcf/v1/* REST handlers.
- bats-core —
scripts/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
Background
With #86 / #87 / #88 merged (closing #63), we now have three independent test runners producing coverage data:
lib/wordpress/*(Next.js data layer). Already supportsnpm run test:coverage(v8 provider).cdcf-redis-translationsplugin andcdcf-headlesstheme/cdcf/v1/*REST handlers.scripts/cdcf_queue_worker.lib.shqueue-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
Phase 2 — bats worker (later)
Out of scope here
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