Getting Started
Parity checks whether source files and their expected tests stay structurally aligned. It reads coverage reports generated by your own test runner, then evaluates rules such as test existence, coverage links, and per-file coverage thresholds.
Install
composer global require testparity/parityConfigure a Project
parity initThis creates parity.yaml. Edit the structure entries so each source directory points at the matching test directory.
Generate Coverage
Use your framework's normal coverage command. For PHP projects, prefer PHPUnit XML when you want per-test attribution:
vendor/bin/phpunit --coverage-xml coverage-xmlUse Clover when you only need portable per-file coverage:
vendor/bin/phpunit --coverage-clover clover.xmlRun Parity
If your coverage artifact already contains per-test attribution, validate it directly:
parity check
parity check --format=jsonIf your runner only produces aggregate Clover or Cobertura coverage, configure isolated execution in parity.yaml:
test:
command: "./vendor/bin/pest {test_abs} --coverage-clover={coverage}"
coverage: ".parity/tmp/{slug}.xml"
reports: ".parity/per-test"
timeout: 300Then generate one report per belonging test and run the check in one command:
parity test
parity test --format=jsonUse parity test --no-check when another CI step will run parity check later. Each isolated runner defaults to a 300-second timeout; pass --timeout=SECONDS to override it.
Exit code 0 means all enforced rules passed. Exit code 1 means Parity found a missing input, missing test, invalid coverage link, or threshold failure.

