Skip to content

Add coverage baseline tooling#229

Merged
roncodes merged 1 commit into
dev-v1.6.54from
feature/core-api-critical-test-coverage
Jul 17, 2026
Merged

Add coverage baseline tooling#229
roncodes merged 1 commit into
dev-v1.6.54from
feature/core-api-critical-test-coverage

Conversation

@roncodes

@roncodes roncodes commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

  • add Composer scripts to generate Pest coverage output and Clover XML
  • add a repo-local coverage runner that fails early when PHP has no Xdebug/PCOV coverage driver
  • add a repo-local Clover parser that prints line, method, and class coverage plus lowest-covered directories/files
  • add CI coverage baseline generation using the existing Xdebug setup and upload the Clover report as an artifact
  • ignore generated coverage and PHPUnit cache directories

Why

This PR establishes a measurable starting coverage percentage before adding more tests. Pest cannot produce coverage without a PHP coverage driver, so the runner now reports that prerequisite directly instead of running tests and failing later because coverage/clover.xml was never created.

Commands

  • composer test:coverage
  • composer test:coverage:clover
  • composer coverage:summary
  • composer coverage:baseline

Local and Docker requirement

Coverage requires one enabled PHP coverage driver:

  • Xdebug with XDEBUG_MODE=coverage
  • PCOV

If neither driver is loaded, composer coverage:baseline exits before running the suite and prints the PHP binary that needs the extension enabled.

Validation

  • ./vendor/bin/pest --colors=never
  • php -l scripts/coverage-runner.php
  • php -l scripts/coverage-summary.php
  • php scripts/coverage-summary.php /tmp/core-api-clover-sample.xml
  • ./vendor/bin/php-cs-fixer fix -v --dry-run --config=.php-cs-fixer.php .github/workflows/ci.yml .gitignore composer.json scripts/coverage-runner.php scripts/coverage-summary.php
  • /usr/local/bin/composer coverage:baseline now fails early with No PHP coverage driver is available on local PHP because neither xdebug nor pcov is loaded.

@roncodes
roncodes force-pushed the feature/core-api-critical-test-coverage branch 2 times, most recently from 62672cd to 971430f Compare July 16, 2026 13:43
@roncodes roncodes changed the title Add critical API test coverage harness Add coverage baseline tooling Jul 16, 2026
@roncodes
roncodes marked this pull request as ready for review July 16, 2026 14:19
@roncodes
roncodes force-pushed the feature/core-api-critical-test-coverage branch from 971430f to 0e3655f Compare July 17, 2026 02:35
Base automatically changed from feature/security-advisory-fixes to dev-v1.6.54 July 17, 2026 02:49
@roncodes
roncodes merged commit 0d58960 into dev-v1.6.54 Jul 17, 2026
@roncodes
roncodes deleted the feature/core-api-critical-test-coverage branch July 17, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant