Skip to content

Commit

Permalink
Build/Test Tools: Remove SpeedTrapListener.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
SergeyBiryukov committed Aug 7, 2021
1 parent e8ea993 commit aae7842
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 645 deletions.
2 changes: 0 additions & 2 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
<exclude-pattern>/src/wp-includes/Text/*</exclude-pattern>

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

<!-- Test data and fixtures. -->
<exclude-pattern>/tests/phpunit/build*</exclude-pattern>
Expand Down Expand Up @@ -266,7 +265,6 @@
<element value="WP_PHPUnit_Util_Getopt"/>
<element value="PHPUnit_Util_Test"/>
<element value="WPProfiler"/>
<element value="SpeedTrapListener"/>
<element value="PHPUnit_Framework_Exception"/>
<element value="Polyfill_TestCase"/>
</property>
Expand Down
11 changes: 0 additions & 11 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@
<php>
<const name="WP_RUN_CORE_TESTS" value="1" />
</php>
<listeners>
<listener class="SpeedTrapListener" file="tests/phpunit/includes/listener-loader.php">
<arguments>
<array>
<element key="slowThreshold">
<integer>150</integer>
</element>
</array>
</arguments>
</listener>
</listeners>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
Expand Down
7 changes: 0 additions & 7 deletions tests/phpunit/includes/listener-loader.php

This file was deleted.

307 changes: 0 additions & 307 deletions tests/phpunit/includes/phpunit7/speed-trap-listener.php

This file was deleted.

Loading

0 comments on commit aae7842

Please sign in to comment.