Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

jakobbuis/simple-slow-test-reporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Slow Test Reporter

Reports slow tests in your PHPUnit testsuite

Example output of slow test reporter, highlighting some slow testcases

Requirements

Requires PHPUnit 9, 10 or 11. Use v1 for PHPUnit 9, and v2 for PHPUnit 10 and later. This extension does not support PHPUnit 8 and earlier versions.

PHPUnit version SSTR version
9.x 1.x
10.x 2.x
11.x 2.x

Installation

PHPUnit 10-11

Add the reporter as a dev dependency:

composer require --dev jakobbuis/simple-slow-test-reporter:"^2.0"

Add the extension to your phpunit.xml file as a root-node:

<phpunit>
    [...]
    <extensions>
        <bootstrap class="SSTR\SlowTestReporter" />
    </extensions>
</phpunit>

Optionally, you can configure the threshold for a slow test. The default is 500 milliseconds.

<phpunit>
    [...]
    <extensions>
        <bootstrap class="SSTR\SlowTestReporter">
            <parameter name="threshold" value="1000"/>
        </bootstrap>
    </extensions>
</phpunit>

PHPUnit 9

Add the reporter as a dev dependency:

composer require --dev jakobbuis/simple-slow-test-reporter:"^1.0"

Add the extension to your phpunit.xml file as a root-node:

<phpunit>
    [...]
    <extensions>
        <extension class="SSTR\SlowTestReporter" />
    </extensions>
</phpunit>

Optionally, you can configure the threshold for a slow test. The default is 500 milliseconds.

<phpunit>
    [...]
    <extensions>
        <extension class="SSTR\SlowTestReporter">
            <arguments>
                <integer>1000</integer>
            </arguments>
        </extension>
    </extensions>
</phpunit>

License

MIT

About

Reports slow tests in your PHPUnit testsuite

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages