Skip to content

Commit aae7842

Browse files
Build/Test Tools: Remove SpeedTrapListener.
Now that the tests can run PHPUnit cross-version and Composer will be used to install the test suite in CI, we could switch out the local copies of the [https://github.com/johnkary/phpunit-speedtrap PHPUnit speedtrap] package in favor of using the Composer package, which would prevent us having to make the WP local copies of the class compatible with later PHPUnit versions. The SpeedTrap test listener was introduced to identify slow tests and take action on these to make them faster. In practice, however, no notable action was ever taken based on the output of the test listener in all the years it was in place. With that in mind, it was decided to remove the SpeedTrap test listeners without replacement. If – at a future date – contributors would want to take action to speed up slow tests anyway, they can: * Either add the package to their local install and use the output they receive locally to identify slow tests. * Or use the PHPUnit native `@small` annotations in combination with the PHPUnit `PHP_Invoker` package as described in the PHPUnit documentation to [https://phpunit.readthedocs.io/en/stable/risky-tests.html#test-execution-timeout run tests with time limits]. Follow-up to [35214], [35226], [35767], [44701], [51559-51572]. Props jrf. See #46149. git-svn-id: https://develop.svn.wordpress.org/trunk@51573 602fd350-edb4-49c9-b593-d223f7449a82
1 parent e8ea993 commit aae7842

File tree

6 files changed

+0
-645
lines changed

6 files changed

+0
-645
lines changed

phpcs.xml.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@
135135
<exclude-pattern>/src/wp-includes/Text/*</exclude-pattern>
136136

137137
<exclude-pattern>/tests/phpunit/includes/phpunit7/MockObject/*</exclude-pattern>
138-
<exclude-pattern>/tests/phpunit/includes/speed-trap-listener\.php</exclude-pattern>
139138

140139
<!-- Test data and fixtures. -->
141140
<exclude-pattern>/tests/phpunit/build*</exclude-pattern>
@@ -266,7 +265,6 @@
266265
<element value="WP_PHPUnit_Util_Getopt"/>
267266
<element value="PHPUnit_Util_Test"/>
268267
<element value="WPProfiler"/>
269-
<element value="SpeedTrapListener"/>
270268
<element value="PHPUnit_Framework_Exception"/>
271269
<element value="Polyfill_TestCase"/>
272270
</property>

phpunit.xml.dist

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,6 @@
2929
<php>
3030
<const name="WP_RUN_CORE_TESTS" value="1" />
3131
</php>
32-
<listeners>
33-
<listener class="SpeedTrapListener" file="tests/phpunit/includes/listener-loader.php">
34-
<arguments>
35-
<array>
36-
<element key="slowThreshold">
37-
<integer>150</integer>
38-
</element>
39-
</array>
40-
</arguments>
41-
</listener>
42-
</listeners>
4332
<filter>
4433
<whitelist addUncoveredFilesFromWhitelist="true">
4534
<directory suffix=".php">src</directory>

tests/phpunit/includes/listener-loader.php

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/phpunit/includes/phpunit7/speed-trap-listener.php

Lines changed: 0 additions & 307 deletions
This file was deleted.

0 commit comments

Comments
 (0)