schenke-io/test-output-formatter

Isolates failing test files and under-coverage classes for rapid triage.

Maintainers

Package info

github.com/schenke-io/test-output-formatter

Type:phpstan-extension

pkg:composer/schenke-io/test-output-formatter

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.0.3 2026-06-06 12:49 UTC

This package is auto-updated.

Last update: 2026-06-06 12:50:27 UTC


README

Version Downloads Tests License PHP

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-extension type in composer.json and the extension.neon file. 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.plugins configuration in composer.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

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

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