diff --git a/.github/workflows/install-testing.yml b/.github/workflows/install-testing.yml index f40f044586c88..f347958e8b4ae 100644 --- a/.github/workflows/install-testing.yml +++ b/.github/workflows/install-testing.yml @@ -90,11 +90,13 @@ jobs: db-version: '8.4' - php: '7.3' db-version: '8.4' + # Only test the latest innovation release. + - db-version: '9.0' # MySQL 9.0+ will not work on PHP 7.2 & 7.3. See https://core.trac.wordpress.org/ticket/61218. - php: '7.2' - db-version: '9.0' + db-version: '9.1' - php: '7.3' - db-version: '9.0' + db-version: '9.1' services: database: diff --git a/.github/workflows/local-docker-environment.yml b/.github/workflows/local-docker-environment.yml index 17d078198c009..09b212e90ead5 100644 --- a/.github/workflows/local-docker-environment.yml +++ b/.github/workflows/local-docker-environment.yml @@ -90,11 +90,13 @@ jobs: exclude: # MySQL containers <= 5.5 do not exist or fail to start properly. - db-version: '5.5' + # Only test the latest innovation release. + - db-version: '9.0' # MySQL 9.0+ will not work on PHP 7.2 & 7.3. See https://core.trac.wordpress.org/ticket/61218. - php: '7.2' - db-version: '9.0' + db-version: '9.1' - php: '7.3' - db-version: '9.0' + db-version: '9.1' with: os: ${{ matrix.os }} diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 3ea45fcdc331e..f52ce971e5489 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -36,7 +36,7 @@ jobs: # test-with-mysql: name: PHP ${{ matrix.php }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests-v3.yml@trunk + uses: ./.github/workflows/reusable-phpunit-tests-v3.yml permissions: contents: read secrets: inherit @@ -47,7 +47,7 @@ jobs: os: [ ubuntu-latest ] php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] db-type: [ 'mysql' ] - db-version: [ '5.7', '8.0', '8.4', '9.0' ] + db-version: [ '5.7', '8.0', '8.4' ] tests-domain: [ 'example.org' ] multisite: [ false, true ] memcached: [ false ] @@ -91,14 +91,6 @@ jobs: multisite: false memcached: false report: true - - exclude: - # MySQL 9.0+ will not work on PHP 7.2 & 7.3. See https://core.trac.wordpress.org/ticket/61218. - - php: '7.2' - db-version: '9.0' - - php: '7.3' - db-version: '9.0' - with: os: ${{ matrix.os }} php: ${{ matrix.php }} @@ -115,7 +107,7 @@ jobs: # test-with-mariadb: name: PHP ${{ matrix.php }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests-v3.yml@trunk + uses: ./.github/workflows/reusable-phpunit-tests-v3.yml permissions: contents: read secrets: inherit @@ -126,7 +118,7 @@ jobs: os: [ ubuntu-latest ] php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] db-type: [ 'mariadb' ] - db-version: [ '10.4', '10.6', '10.11', '11.2' ] + db-version: [ '5.5', '10.3', '10.4', '10.5', '10.6', '10.11', '11.4' ] multisite: [ false, true ] memcached: [ false ] @@ -135,13 +127,13 @@ jobs: - os: ubuntu-latest php: '8.3' db-type: 'mariadb' - db-version: '11.2' + db-version: '11.4' multisite: false memcached: true - os: ubuntu-latest php: '8.3' db-type: 'mariadb' - db-version: '11.2' + db-version: '11.4' multisite: true memcached: true with: @@ -154,12 +146,61 @@ jobs: phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }} report: ${{ matrix.report || false }} + # + # Creates PHPUnit test jobs to test MariaDB and MySQL innovation releases. + # + # Though innovation releases are deemed "production grade" and never receive LTS status, they include new features + # and updates that will be included in the next LTS version. + # + # Because upstream support for innovation releases gets dropped when a new one is released, only the most recent + # innovation version is tested. + # + test-innovation-releases: + name: PHP ${{ matrix.php }} + uses: ./.github/workflows/reusable-phpunit-tests-v3.yml + permissions: + contents: read + secrets: inherit + if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest ] + php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] + db-type: [ 'mysql', 'mariadb' ] + db-version: [ '9.1', '11.6' ] + multisite: [ false, true ] + memcached: [ false ] + db-innovation: [ true ] + + exclude: + # MySQL 9.0+ will not work on PHP <= 7.3 because mysql_native_password was removed. See https://core.trac.wordpress.org/ticket/61218. + - php: '7.2' + db-version: '9.1' + - php: '7.3' + db-version: '9.1' + # Exclude version combinations that don't exist. + - db-type: 'mariadb' + db-version: '9.1' + - db-type: 'mysql' + db-version: '11.6' + with: + os: ${{ matrix.os }} + php: ${{ matrix.php }} + db-type: ${{ matrix.db-type }} + db-version: ${{ matrix.db-version }} + db-innovation: ${{ matrix.db-innovation }} + multisite: ${{ matrix.multisite }} + memcached: ${{ matrix.memcached }} + phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }} + report: ${{ matrix.report || false }} + # # Runs specific individual test groups. # specific-test-groups: name: ${{ matrix.phpunit-test-groups }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests-v3.yml@trunk + uses: ./.github/workflows/reusable-phpunit-tests-v3.yml permissions: contents: read secrets: inherit @@ -183,7 +224,7 @@ jobs: permissions: actions: read contents: read - needs: [ test-with-mysql, test-with-mariadb, specific-test-groups ] + needs: [ test-with-mysql, test-with-mariadb, test-innovation-releases, specific-test-groups ] if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} with: calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index cac3015af383a..3d26efa7026b2 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -27,6 +27,11 @@ on: required: false type: 'string' default: '8.4' + db-innovation: + description: 'Whether a database software innovation release is being tested.' + required: false + type: 'boolean' + default: false multisite: description: 'Whether to run tests as multisite' required: false @@ -105,7 +110,7 @@ jobs: # - Checks out the WordPress Test reporter repository. # - Submit the test results to the WordPress.org host test results. phpunit-tests: - name: ${{ inputs.phpunit-test-groups && format( '{0} / ', inputs.phpunit-test-groups ) || '' }}PHP ${{ inputs.php }} ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report && '/ ' || 'with ' }}${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.multisite && ' multisite' || '' }}${{ inputs.memcached && ' with memcached' || '' }}${{ inputs.report && ' (test reporting enabled)' || '' }} ${{ 'example.org' != inputs.tests-domain && inputs.tests-domain || '' }} + name: ${{ inputs.phpunit-test-groups && format( '{0} / ', inputs.phpunit-test-groups ) || '' }}PHP ${{ inputs.php }} ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report && '/ ' || 'with ' }}${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.multisite && ' multisite' || '' }}${{ inputs.db-innovation && ' (innovation release)' || '' }}${{ inputs.memcached && ' with memcached' || '' }}${{ inputs.report && ' (test reporting enabled)' || '' }} ${{ 'example.org' != inputs.tests-domain && inputs.tests-domain || '' }} runs-on: ${{ inputs.os }} timeout-minutes: ${{ inputs.coverage-report && 120 || 20 }} diff --git a/.version-support-mysql.json b/.version-support-mysql.json index f6cffac449cae..8616ffb294e43 100644 --- a/.version-support-mysql.json +++ b/.version-support-mysql.json @@ -1,5 +1,6 @@ { "6-8": [ + "9.1", "9.0", "8.4", "8.0", diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php index 3e06afcc1bf2c..57f5db65a2f5a 100644 --- a/tests/phpunit/tests/db.php +++ b/tests/phpunit/tests/db.php @@ -296,7 +296,7 @@ public function test_set_sql_mode() { $check_new_modes = $wpdb->get_var( 'SELECT @@SESSION.sql_mode;' ); $this->assertSameSets( $new_modes, explode( ',', $check_new_modes ) ); - $wpdb->set_sql_mode( explode( ',', $current_modes ) ); + $wpdb->set_sql_mode( empty( $current_modes ) ? array() : explode( ',', $current_modes ) ); } /**