Make WordPress Core

Changeset 51573 for trunk/phpcs.xml.dist

08/07/2021 11:14:39 AM (3 years ago)

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 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 run tests with time limits.

Follow-up to [35214], [35226], [35767], [44701], [51559-51572].

Props jrf.
See #46149.

1 edited


  • trunk/phpcs.xml.dist

    r51567 r51573  
    137137    <exclude-pattern>/tests/phpunit/includes/phpunit7/MockObject/*</exclude-pattern>
    138     <exclude-pattern>/tests/phpunit/includes/speed-trap-listener\.php</exclude-pattern>
    140139    <!-- Test data and fixtures. -->
    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"/>
Note: See TracChangeset for help on using the changeset viewer.