PHPUnit: report slow tests. (#51253)

Enables reporting slow PHPUnit tests as part of testing [progress output.
This commit is contained in:
Vladimir Reznichenko 2024-09-10 12:37:23 +02:00 committed by GitHub
parent d53c5a2222
commit 9fd4b54902
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 72 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Add reporting of slow PHPUnit tests.

View File

@ -41,6 +41,7 @@
"automattic/jetpack-changelogger": "^3.3.0",
"bamarni/composer-bin-plugin": "^1.4",
"dms/phpunit-arraysubset-asserts": "^0.4.0",
"johnkary/phpunit-speedtrap": "*",
"mockery/mockery": "1.6.6",
"phpunit/phpunit": "^9.6",
"sebastian/comparator": "^4.0",

View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "e481b35f50815040071d81943b40b880",
"content-hash": "15d426b01c8ba919cabdd7078845595e",
"packages": [
{
"name": "automattic/jetpack-a8c-mc-stats",
@ -1866,6 +1866,58 @@
},
"time": "2020-07-09T08:09:16+00:00"
},
{
"name": "johnkary/phpunit-speedtrap",
"version": "v4.0.1",
"source": {
"type": "git",
"url": "https://github.com/johnkary/phpunit-speedtrap.git",
"reference": "d6600d2218396b78856c335f83479503957a5fa9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/johnkary/phpunit-speedtrap/zipball/d6600d2218396b78856c335f83479503957a5fa9",
"reference": "d6600d2218396b78856c335f83479503957a5fa9",
"shasum": ""
},
"require": {
"php": ">=7.1",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
}
},
"autoload": {
"psr-4": {
"JohnKary\\PHPUnit\\Listener\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "John Kary",
"email": "john@johnkary.net"
}
],
"description": "Find and report on slow tests in your PHPUnit test suite",
"homepage": "https://github.com/johnkary/phpunit-speedtrap",
"keywords": [
"phpunit",
"profile",
"slow"
],
"support": {
"issues": "https://github.com/johnkary/phpunit-speedtrap/issues",
"source": "https://github.com/johnkary/phpunit-speedtrap/tree/v4.0.1"
},
"time": "2022-10-17T00:56:56+00:00"
},
{
"name": "jolicode/jolinotif",
"version": "v2.4.0",

View File

@ -17,6 +17,20 @@
<exclude>./tests/php/helpers</exclude>
</testsuite>
</testsuites>
<listeners>
<listener class="JohnKary\PHPUnit\Listener\SpeedTrapListener">
<arguments>
<array>
<element key="slowThreshold">
<integer>1000</integer>
</element>
<element key="reportLength">
<integer>25</integer>
</element>
</array>
</arguments>
</listener>
</listeners>
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">./includes</directory>