Skip to content

Drop-in CLI for coverage ownership checks

Variation 02 / Developer

Add a file-owned coverage gate in one config file.

Install Parity, point it at your existing coverage artifact, and ask the only local question that matters: did the belonging test meaningfully cover this file?

terminalquickstart
composer require --dev testparity/parity
php vendor/bin/parity init

XDEBUG_MODE=coverage ./vendor/bin/pest \
  --coverage-xml=coverage-xml \
  --coverage-clover=clover.xml

php vendor/bin/parity check --format=json
Runs with your stackPestPHPUnitJestMochaVitest
parity.yamlminimum
structure:
  - name: Services
    paths:
      source: app/Services
      test: tests/Unit/Services
    rules:
      - test-exists
      - matched-coverage:
          min: 70

Designed not to replace your runner.

Parity runs after Pest, PHPUnit, Jest, Mocha, Vitest, Cargo, or another runner has produced coverage. It reads Parity JSON, PHPUnit XML, Clover XML, or Cobertura XML and checks structure, ownership, and matched coverage when attribution is available.

  • Deterministic exit codes for CI
  • JSON for automation
  • Table output for local review
1Keep your test runner

Use Pest, PHPUnit, Jest, Mocha, Vitest, Cargo, or your existing runner exactly as before. Parity only needs a supported coverage file or an attribution converter.

2Model ownership

Declare where application files live, where belonging tests live, and which rule minimums should block a merge.

3Read the failure

The output points to the exact source/test pair instead of asking the author to interpret a global percentage.

Output designed for scripts and humans.

Local runs can use table output. CI can ingest JSON and annotate the pull request with file-level accountability.

  • passed for release state
  • source and test for the exact pair
  • rules for policy-specific values
jsonfailure
{
  "source": "app/Services/CheckoutGateway.php",
  "test": "tests/Unit/Services/CheckoutGatewayTest.php",
  "rules": {
    "matched-coverage": {
      "value": "18%",
      "min": "70%",
      "passed": false
    }
  }
}
php vendor/bin/parity listPreview source/test pairs before enforcing.
php vendor/bin/parity checkRun the release gate locally or in CI.
php vendor/bin/parity check --format=jsonEmit machine-readable failures.