Make WordPress Core

Changeset 51573


Ignore:
Timestamp:
08/07/2021 11:14:39 AM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk
Files:
3 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpcs.xml.dist

    r51567 r51573  
    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. -->
     
    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"/>
  • trunk/phpunit.xml.dist

    r50592 r51573  
    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">
  • trunk/tests/phpunit/multisite.xml

    r50592 r51573  
    2929        </exclude>
    3030    </groups>
    31     <listeners>
    32         <listener class="SpeedTrapListener" file="tests/phpunit/includes/listener-loader.php">
    33             <arguments>
    34                 <array>
    35                     <element key="slowThreshold">
    36                         <integer>150</integer>
    37                     </element>
    38                 </array>
    39             </arguments>
    40         </listener>
    41     </listeners>
    4231    <filter>
    4332        <whitelist addUncoveredFilesFromWhitelist="true">
Note: See TracChangeset for help on using the changeset viewer.