Make WordPress Core

Changeset 52421


Ignore:
Timestamp:
12/29/2021 04:34:12 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Tests: Correct the check for the recommended MySQL version in readme.html.

This updates the regular expression in the test to retrieve the date of the first, instead of the last, GA release for the recommended MySQL branch, in order to properly track the EOL date.

Additionally, as the currently recommended MySQL 5.7 branch moved from active support to extended support on 2020-10-21, and WordPress core is not fully compatible with MySQL 8.0 at this time, this commit increases the “supported” period from 5 to 8 years to include extended support.

Follow-up to [31291], [35759], [meta11407], [52420].

See #41490.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/external-http/basic.php

    r52418 r52421  
    4141        $response_body = $this->get_response_body( "https://dev.mysql.com/doc/relnotes/mysql/{$matches[1]}/en/" );
    4242
    43         preg_match( '#(\d{4}-\d{2}-\d{2}), General Availability#', $response_body, $mysqlmatches );
     43        // Retrieve the date of the first GA release for the recommended branch.
     44        preg_match( '#.*(\d{4}-\d{2}-\d{2}), General Availability#s', $response_body, $mysqlmatches );
    4445
    45         // Per https://www.mysql.com/support/, Oracle actively supports MySQL releases for 5 years from GA release.
    46         $mysql_eol = strtotime( $mysqlmatches[1] . ' +5 years' );
     46        /*
     47         * Per https://www.mysql.com/support/, Oracle actively supports MySQL releases for 5 years from GA release.
     48         *
     49         * The currently recommended MySQL 5.7 branch moved from active support to extended support on 2020-10-21.
     50         * As WordPress core is not fully compatible with MySQL 8.0 at this time, the "supported" period here
     51         * is increased to 8 years to include extended support.
     52         *
     53         * TODO: Reduce this back to 5 years once MySQL 8.0 compatibility is achieved.
     54         */
     55        $mysql_eol = strtotime( $mysqlmatches[1] . ' +8 years' );
    4756
    4857        $this->assertLessThan( $mysql_eol, time(), "readme.html's Recommended MySQL version is too old. Remember to update the WordPress.org Requirements page, too." );
Note: See TracChangeset for help on using the changeset viewer.