Skip to content

Add --compact option to only list test files with failures #6181

@niels-numbers

Description

@niels-numbers

Description:

In large test suites, the default PHPUnit output can become overwhelming, especially when multiple tests fail and full stack traces are printed.

Feature Request:

Introduce a --compact (or similar) CLI option that suppresses detailed test output and instead prints a concise list of test classes (or files) that contain one or more failing tests.

Example desired output:

user:/home$ phpunit --compact
PHPUnit 9.6.22 by Sebastian Bergmann and contributors.

.....................................W.........................  63 / 367 ( 23%)
..................W....................W....................... 126 / 367 ( 51%)
..............F................................................ 189 / 367 ( 76%)
..............................FFFFF............................ 252 / 252 (100%)

Time: 00:40.492, Memory: 46.00 MB

The following test classes contain failing tests:
- Tests\Feature\LoginTest
- Tests\Unit\UserModelTest

Tests: 252, Assertions: 937, Errors: 6, Warnings: 3.

This option would be useful during TDD, CI pipelines, and quick failure reviews, helping developers focus on which areas need attention without being flooded by verbose traces.

Is this something that could be considered?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions