Skip to content

Configuration

Parity reads parity.yaml from the current project root, or from --config.

yaml
settings:
  namespace_roots:
    app: App
    tests: Tests
  source_extension: ".php"
  test_suffix: "Test"
  test_extension: ".php"
  namespace_separator: "\\"

coverage_xml: [.parity/per-test, parity-coverage.json, coverage-xml, clover.xml, cobertura.xml]
min_coverage: 80
min_coverage_global: 80

structure:
  - name: "Unit Services"
    paths:
      source: "app/Services"
      test: "tests/Unit/Services"
    rules:
      - enforce-coverage-link
      - minimum-coverage:
          min: 80

Multi-Language Layouts

Set source_extension, test_suffix, test_extension, and namespace_separator for the target ecosystem. The public samples cover PHP, Laravel-style PHP, TypeScript, AdonisJS-style TypeScript, Rust, PHPUnit, Pest, Jest, Mocha, Vitest, and Cargo.

Use language-specific coverage tooling to produce a supported report, then point coverage_xml at the report or an ordered fallback list.

EcosystemTypical artifactNotes
PHP + PHPUnitcoverage-xml/, clover.xmlUse PHPUnit XML for attribution; Clover for fallback.
PHP + Pestcoverage-xml/, clover.xmlPest can also validate ->covers() ownership links.
JavaScript + Jestclover.xml, parity-coverage.jsonUse Parity JSON when a converter can provide attribution.
JavaScript + Mocha/NYCclover.xml, parity-coverage.jsonClover supports per-file thresholds only.
TypeScript + Vitestclover.xml, cobertura.xml, parity-coverage.jsonChange extensions and suffixes for Vite layouts.
Rust + Cargocobertura.xml, parity-coverage.jsonCobertura is a common aggregate coverage exchange format.

Per-Test Report Generation

When the native coverage format cannot identify individual tests, configure parity test:

yaml
test:
  command: "./vendor/bin/pest {test_abs} --coverage-clover={coverage}"
  coverage: ".parity/tmp/{slug}.xml"
  reports: ".parity/per-test"
  timeout: 300
PlaceholderValue
{test}Expected test path relative to the project root
{test_abs}Absolute expected test path
{coverage}Absolute isolated coverage artifact path
{slug}Stable short hash for the expected test path
{project_root}Absolute project root

reports defaults to .parity/per-test, and timeout defaults to 300 seconds per isolated runner. --output and --timeout override those values. parity test runs parity check after generation unless --no-check is supplied.

test.command is executed through the system shell. Parity shell-escapes placeholder values, but the command template itself is trusted executable configuration. Review parity.yaml before running parity test, especially in privileged CI or on pull requests from forks.

Keep temporary artifacts under .parity/ and separate from test.reports. Parity removes each runner artifact after use, stages complete reports, and refuses roots, nested symlinks, overlapping paths, files, or unowned non-empty output directories before it deletes anything.