Skip to content

Beautiful failures for test ownership

Variation 05 / CI Room

Make weak test ownership fail before merge.

Parity gives CI a concrete release rule: every application file must have its belonging test, and that test must cover enough of the file to count.

Blocked

CheckoutGateway.php

CheckoutGatewayTest.php exists, but matched coverage is below policy.

18% / 70%
Fix by testing the gateway behavior in the belonging test, not by raising unrelated global coverage.
Designed for pull requestsExit codesJSONTablesExact file paths
Push

Native tests produce coverage.

Check

Parity links source files to tests.

Block

CI fails on missing or weak matched coverage.

Review

JSON names the exact rule and file.

github actionsparity
Run php vendor/bin/parity check --format=json

Services: 2 passed, 1 failed

FAIL app/Services/CheckoutGateway.php
  expected test: tests/Unit/Services/CheckoutGatewayTest.php
  matched coverage: 18%
  required: 70%

Error: Process completed with exit code 1.

Reviewer experience

CI should say what changed, where, and why it cannot ship.

Parity turns weak test ownership into a concrete release failure. The author can fix the belonging test directly instead of chasing an abstract quality score.

Requiredtest-exists

Every application file maps to a belonging test file.

Optionalcovers-class

PHPUnit attributes or Pest covers declarations prove ownership intent.

Requiredmatched-coverage

The belonging test covers enough executable lines in its file.

Best for teams already bought into release gates.

The CI room style is sharper and more operational. It works well for DevOps and platform audiences, but should be paired with a clearer product explanation for first-time visitors.