schenke-io / test-output-formatter
Isolates failing test files and under-coverage classes for rapid triage.
Package info
github.com/schenke-io/test-output-formatter
Type:phpstan-extension
pkg:composer/schenke-io/test-output-formatter
v0.0.3
2026-06-06 12:49 UTC
Requires
- php: ^8.3
- pestphp/pest: ^3.0|^4.0
Requires (Dev)
- laravel/pint: ^1.29
- mockery/mockery: ^1.6
- phpstan/phpstan: ^2.2
- phpstan/phpstan-phpunit: ^2.0
- schenke-io/packaging-tools: *
- symfony/process: ^7.0
README
Test Output Formatter
Isolates failing test files and under-coverage classes for rapid triage.Benefits for AI and Triage
- Token Efficiency: Minimizes output to only what's necessary, saving tokens and reducing noise in AI-driven workflows.
- Rapid Triage: Focuses attention on the 1% of files that actually need fixing, speeding up the development cycle.
Installation
composer require --dev schenke-io/test-output-formatter
Auto-Registration
The package uses standard discovery mechanisms to integrate with your tools:
- PHPStan: The extension is automatically registered via the
phpstan-extensiontype incomposer.jsonand theextension.neonfile. For this to work seamlessly, it is highly recommended to install the extension installer:
composer require --dev phpstan/extension-installer
- Pest: The plugin is automatically registered through the
extra.pest.pluginsconfiguration incomposer.json. No additional configuration is required.
Features
PHPStan
- Error Formatter: Output only file paths with errors for quick consumption by other tools.
- Usage:
- File paths only:
vendor/bin/phpstan analyse --error-format=testOutput
- Compact format: (file:line message)
vendor/bin/phpstan analyse --error-format=testOutputCompact
- JSON format:
vendor/bin/phpstan analyse --error-format=testOutputJson
- File paths only:
Pest
- Integration: Plugin to assist in isolating failing tests and checking coverage.
- Usage:
- Failures only: Just gives you the list of failing test files.
vendor/bin/pest --parallel --failed-files-only
- Coverage check: Reports classes with line coverage below the specified threshold.
vendor/bin/pest --parallel --under=80
- Slow tests: Identifies tests that take longer than a threshold or the N slowest tests.
vendor/bin/pest --parallel --over=100 --slowest=5
- Failures only: Just gives you the list of failing test files.
ErrorFormatter
Public methods of ErrorFormatter
| method | summary |
|---|---|
| formatErrors | Formats the errors and outputs them to the console. |
CompactErrorFormatter
Custom PHPStan error formatter that outputs one line per error
Public methods of CompactErrorFormatter
| method | summary |
|---|---|
| formatErrors | - |
JsonErrorFormatter
Public methods of JsonErrorFormatter
| method | summary |
|---|---|
| formatErrors | - |
Markdown file generated by schenke-io/packaging-tools