From e61b548d7651db8c2be9af19a16f0ffed43b6cc1 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 4 Sep 2025 18:43:57 +0100 Subject: [PATCH 01/13] Instruct the mysql binary to not verify SSL certs. --- docker-compose.yml | 1 + tools/local-env/mysql-client.cnf | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 tools/local-env/mysql-client.cnf diff --git a/docker-compose.yml b/docker-compose.yml index 863cbd2ea9b1b..eb8bae8b83d62 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -110,6 +110,7 @@ services: volumes: - ./:/var/www + - ./tools/local-env/mysql-client.cnf:/etc/mysql/conf.d/no-ssl.cnf:ro # Keeps the service alive. command: 'sleep infinity' diff --git a/tools/local-env/mysql-client.cnf b/tools/local-env/mysql-client.cnf new file mode 100644 index 0000000000000..f5e5c84d116e4 --- /dev/null +++ b/tools/local-env/mysql-client.cnf @@ -0,0 +1,2 @@ +[client] +ssl=0 From 2d5ee5d7b05e8b463e9fddfaa9110db68d47071f Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 4 Sep 2025 18:44:57 +0100 Subject: [PATCH 02/13] Instruct WP-CLI to not use the `--no-defaults` flag when shelling out to the mysql client. --- tools/local-env/scripts/install.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/local-env/scripts/install.js b/tools/local-env/scripts/install.js index 3ea702d021e24..44b9d1596a7ee 100644 --- a/tools/local-env/scripts/install.js +++ b/tools/local-env/scripts/install.js @@ -46,7 +46,7 @@ wait_on( { process.exit( 1 ); } ) .then( () => { - wp_cli( 'db reset --yes' ); + wp_cli( 'db reset --yes --defaults' ); const installCommand = process.env.LOCAL_MULTISITE === 'true' ? 'multisite-install' : 'install'; wp_cli( `core ${ installCommand } --title="WordPress Develop" --admin_user=admin --admin_password=password --admin_email=test@example.com --skip-email --url=http://localhost:${process.env.LOCAL_PORT}` ); } ) From 93bc7d6226b893d3802e832bd556e5adb99a466e Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 4 Sep 2025 18:45:21 +0100 Subject: [PATCH 03/13] Don't need these any more. --- .github/workflows/reusable-end-to-end-tests.yml | 6 ------ .../workflows/reusable-performance-test-v2.yml | 6 ------ .github/workflows/reusable-phpunit-tests-v3.yml | 6 ------ ...reusable-test-local-docker-environment-v1.yml | 6 ------ .../php-8.3-docker-compose.override.yml | 16 ---------------- .../php-8.4-docker-compose.override.yml | 16 ---------------- 6 files changed, 56 deletions(-) delete mode 100644 tools/local-env/php-8.3-docker-compose.override.yml delete mode 100644 tools/local-env/php-8.4-docker-compose.override.yml diff --git a/.github/workflows/reusable-end-to-end-tests.yml b/.github/workflows/reusable-end-to-end-tests.yml index 187ea7e241bb1..b0a70156bf137 100644 --- a/.github/workflows/reusable-end-to-end-tests.yml +++ b/.github/workflows/reusable-end-to-end-tests.yml @@ -81,12 +81,6 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false - - name: Create a Docker override file - if: ${{ contains( fromJSON('["8.3", "8.4"]'), inputs.php-version ) }} - env: - PHP_VERSION: ${{ inputs.php-version }} - run: cp "tools/local-env/php-$PHP_VERSION-docker-compose.override.yml" docker-compose.override.yml - - name: Set up Node.js uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 with: diff --git a/.github/workflows/reusable-performance-test-v2.yml b/.github/workflows/reusable-performance-test-v2.yml index a61234afb5e33..94b5f9933e65f 100644 --- a/.github/workflows/reusable-performance-test-v2.yml +++ b/.github/workflows/reusable-performance-test-v2.yml @@ -121,12 +121,6 @@ jobs: fetch-depth: ${{ github.event_name == 'workflow_dispatch' && '2' || '1' }} persist-credentials: false - - name: Create a Docker override file - if: ${{ contains( fromJSON('["8.3", "8.4"]'), inputs.php-version ) }} - env: - PHP_VERSION: ${{ inputs.php-version }} - run: cp "tools/local-env/php-$PHP_VERSION-docker-compose.override.yml" docker-compose.override.yml - - name: Set up Node.js uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 with: diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index bae7dd436f5a3..fd4b83fdd4807 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -136,12 +136,6 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false - - name: Create a Docker override file - if: ${{ contains( fromJSON('["8.3", "8.4"]'), inputs.php ) }} - env: - PHP_VERSION: ${{ inputs.php }} - run: cp "tools/local-env/php-${{ env.PHP_VERSION }}-docker-compose.override.yml" docker-compose.override.yml - - name: Set up Node.js uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 with: diff --git a/.github/workflows/reusable-test-local-docker-environment-v1.yml b/.github/workflows/reusable-test-local-docker-environment-v1.yml index d62f4a1eb91e3..bc9b3d316d599 100644 --- a/.github/workflows/reusable-test-local-docker-environment-v1.yml +++ b/.github/workflows/reusable-test-local-docker-environment-v1.yml @@ -91,12 +91,6 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false - - name: Create a Docker override file - if: ${{ contains( fromJSON('["8.3", "8.4"]'), inputs.php ) }} - env: - PHP_VERSION: ${{ inputs.php }} - run: cp "tools/local-env/php-$PHP_VERSION-docker-compose.override.yml" docker-compose.override.yml - - name: Set up Node.js uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 with: diff --git a/tools/local-env/php-8.3-docker-compose.override.yml b/tools/local-env/php-8.3-docker-compose.override.yml deleted file mode 100644 index c9e2a647b4b8d..0000000000000 --- a/tools/local-env/php-8.3-docker-compose.override.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This override file is a temporary solution to force the use of specific versions of the -# `wordpressdevelop/php` and `wordpressdevelop/cli` images while the cause of recent failures -# can be investigated. See https://core.trac.wordpress.org/ticket/63876. -services: - - php: - image: wordpressdevelop/php@sha256:c0ba85936a9d1ac2c98bf3da2d62ceb0e5787a6b11e383630df0c5a5bf2534b5 - - cli: - image: wordpressdevelop/cli@sha256:85ad7d7a9c3bd9a8775fc83aea7f7dfc0aad25b2bc4f7d740696b28cd2a0ef89 - - memcached: - # Pinning to the latest `bookworm` image is a temporary solution - # while the cause of recent failures can be investigated. - # See https://core.trac.wordpress.org/ticket/63876. - image: memcached:1.6.38-bookworm diff --git a/tools/local-env/php-8.4-docker-compose.override.yml b/tools/local-env/php-8.4-docker-compose.override.yml deleted file mode 100644 index 12f07e788c2b8..0000000000000 --- a/tools/local-env/php-8.4-docker-compose.override.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This override file is a temporary solution to force the use of specific versions of the -# `wordpressdevelop/php` and `wordpressdevelop/cli` images while the cause of recent failures -# can be investigated. See https://core.trac.wordpress.org/ticket/63876. -services: - - php: - image: wordpressdevelop/php@sha256:56d6cbf10d25bfcb80852c09c2fc2e967922881b233b6161ad2999df509eb59a - - cli: - image: wordpressdevelop/cli@sha256:379f27b0c623c5cee5a7fbef1d617ce47fd3ba19158bac2e51861876fd68fdbf - - memcached: - # Pinning to the latest `bookworm` image is a temporary solution - # while the cause of recent failures can be investigated. - # See https://core.trac.wordpress.org/ticket/63876. - image: memcached:1.6.38-bookworm From b2d528a2793a3a132b1d8622651de5e5de12fff5 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 4 Sep 2025 19:15:36 +0100 Subject: [PATCH 04/13] Re-enable testing on Memcached. --- .github/workflows/local-docker-environment.yml | 2 +- .github/workflows/performance.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/local-docker-environment.yml b/.github/workflows/local-docker-environment.yml index 9e9b1259ea60d..bf275abd72205 100644 --- a/.github/workflows/local-docker-environment.yml +++ b/.github/workflows/local-docker-environment.yml @@ -92,7 +92,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-24.04 ] - memcached: [ false ] + memcached: [ false, true ] php: ${{ fromJSON( needs.build-test-matrix.outputs.php-versions ) }} db-version: ${{ fromJSON( needs.build-test-matrix.outputs.mysql-versions ) }} diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 2db92975d7b28..43970724574ae 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -101,7 +101,7 @@ jobs: strategy: fail-fast: false matrix: - memcached: [ false ] + memcached: [ false, true ] multisite: [ true, false ] subject: ${{ fromJson( needs.determine-matrix.outputs.subjects ) }} with: @@ -119,7 +119,7 @@ jobs: strategy: fail-fast: false matrix: - memcached: [ false ] + memcached: [ false, true ] multisite: [ true, false ] # A matrix value is needed in the 'name' directive for proper grouping in the GitHub UI. label: [ Compare ] From b8d328882aa2a51e4ab125790c6b32960270d81b Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 4 Sep 2025 22:45:50 +0100 Subject: [PATCH 05/13] Add missing assertions for error conditions in the image resize tests. --- tests/phpunit/tests/image/resize.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/phpunit/tests/image/resize.php b/tests/phpunit/tests/image/resize.php index f4fe8632a0580..e24cb9764e7e5 100644 --- a/tests/phpunit/tests/image/resize.php +++ b/tests/phpunit/tests/image/resize.php @@ -23,6 +23,8 @@ public function wp_image_editors() { public function test_resize_jpg() { $image = $this->resize_helper( DIR_TESTDATA . '/images/test-image.jpg', 25, 25 ); + $this->assertNotWPError( $image ); + list( $w, $h, $type ) = getimagesize( $image ); unlink( $image ); @@ -78,6 +80,8 @@ public function test_resize_webp() { $image = $this->resize_helper( $file, 25, 25 ); + $this->assertNotWPError( $image ); + list( $w, $h, $type ) = wp_getimagesize( $image ); unlink( $image ); @@ -104,6 +108,8 @@ public function test_resize_avif() { $image = $this->resize_helper( $file, 25, 25 ); + $this->assertNotWPError( $image ); + list( $w, $h, $type ) = wp_getimagesize( $image ); unlink( $image ); @@ -130,6 +136,8 @@ public function test_resize_heic() { $image = $this->resize_helper( $file, 25, 25 ); + $this->assertNotWPError( $image ); + list( $w, $h, $type ) = wp_getimagesize( $image ); unlink( $image ); @@ -151,6 +159,8 @@ public function test_resize_larger() { public function test_resize_thumb_128x96() { $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 96 ); + $this->assertNotWPError( $image ); + list( $w, $h, $type ) = getimagesize( $image ); unlink( $image ); @@ -164,6 +174,8 @@ public function test_resize_thumb_128x96() { public function test_resize_thumb_128x0() { $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 0 ); + $this->assertNotWPError( $image ); + list( $w, $h, $type ) = getimagesize( $image ); unlink( $image ); @@ -177,6 +189,8 @@ public function test_resize_thumb_128x0() { public function test_resize_thumb_0x96() { $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 0, 96 ); + $this->assertNotWPError( $image ); + list( $w, $h, $type ) = getimagesize( $image ); unlink( $image ); @@ -190,6 +204,8 @@ public function test_resize_thumb_0x96() { public function test_resize_thumb_150x150_crop() { $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 150, 150, true ); + $this->assertNotWPError( $image ); + list( $w, $h, $type ) = getimagesize( $image ); unlink( $image ); @@ -203,6 +219,8 @@ public function test_resize_thumb_150x150_crop() { public function test_resize_thumb_150x100_crop() { $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 150, 100, true ); + $this->assertNotWPError( $image ); + list( $w, $h, $type ) = getimagesize( $image ); unlink( $image ); @@ -216,6 +234,8 @@ public function test_resize_thumb_150x100_crop() { public function test_resize_thumb_50x150_crop() { $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 50, 150, true ); + $this->assertNotWPError( $image ); + list( $w, $h, $type ) = getimagesize( $image ); unlink( $image ); @@ -240,6 +260,8 @@ public function test_resize_non_existent_image() { /** * Function to help out the tests + * + * @return string|WP_Error The path to the resized image file or a WP_Error on failure. */ protected function resize_helper( $file, $width, $height, $crop = false ) { $editor = wp_get_image_editor( $file ); From e586bcd972830edb5715e2449a0d8ffd97fda83e Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 4 Sep 2025 22:46:17 +0100 Subject: [PATCH 06/13] Temporarily disable this on the Trixie based PHP containers. --- tests/phpunit/tests/image/editorImagick.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/phpunit/tests/image/editorImagick.php b/tests/phpunit/tests/image/editorImagick.php index f6390fe3492e1..42f80f13158f4 100644 --- a/tests/phpunit/tests/image/editorImagick.php +++ b/tests/phpunit/tests/image/editorImagick.php @@ -701,6 +701,9 @@ static function ( $value ) { * Test filter `image_max_bit_depth` correctly sets the maximum bit depth of resized images. * * @ticket 62285 + * + * // Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. + * @requires PHP < 8.3 */ public function test_image_max_bit_depth() { $file = DIR_TESTDATA . '/images/colors_hdr_p3.avif'; From 8251affa427c24f6e2c6a9d8c62dd6847469e473 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 4 Sep 2025 23:09:22 +0100 Subject: [PATCH 07/13] Add more missing assertions. --- tests/phpunit/tests/media.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php index 549e92eaf60c9..7c98cefcce45a 100644 --- a/tests/phpunit/tests/media.php +++ b/tests/phpunit/tests/media.php @@ -5460,6 +5460,9 @@ public function test_quality_with_image_conversion_file_sizes() { // Sub-sizes: for each size, the JPEGs should be smaller than the WebP. $sizes_to_compare = array_intersect_key( $jpeg_sizes['sizes'], $webp_sizes['sizes'] ); + + $this->assertNotEmpty( $sizes_to_compare ); + foreach ( $sizes_to_compare as $size => $size_data ) { $this->assertLessThan( $webp_sizes['sizes'][ $size ]['filesize'], $jpeg_sizes['sizes'][ $size ]['filesize'] ); } @@ -5503,6 +5506,8 @@ public function test_quality_with_avif_conversion_file_sizes() { // Sub-sizes: for each size, the AVIF should be smaller than the JPEG. $sizes_to_compare = array_intersect_key( $avif_sizes['sizes'], $smaller_avif_sizes['sizes'] ); + $this->assertNotEmpty( $sizes_to_compare ); + foreach ( $sizes_to_compare as $size => $size_data ) { $this->assertLessThan( $avif_sizes['sizes'][ $size ]['filesize'], $smaller_avif_sizes['sizes'][ $size ]['filesize'] ); } From e83da33bcb7513ec21afb7390d167cb447b06486 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 4 Sep 2025 23:12:59 +0100 Subject: [PATCH 08/13] Disable some more tests on < 8.3. --- tests/phpunit/tests/image/editorImagick.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/phpunit/tests/image/editorImagick.php b/tests/phpunit/tests/image/editorImagick.php index 42f80f13158f4..6bcfceefb4768 100644 --- a/tests/phpunit/tests/image/editorImagick.php +++ b/tests/phpunit/tests/image/editorImagick.php @@ -703,6 +703,7 @@ static function ( $value ) { * @ticket 62285 * * // Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. + * // See https://core.trac.wordpress.org/ticket/63932. * @requires PHP < 8.3 */ public function test_image_max_bit_depth() { @@ -774,6 +775,10 @@ public function __return_eight() { * * @dataProvider data_resizes_are_small_for_16bit_images * + * // Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. + * // See https://core.trac.wordpress.org/ticket/63932. + * @requires PHP < 8.3 + * * @param string $file Path to the image file. */ public function test_resizes_are_small_for_16bit_images( $file ) { @@ -829,6 +834,10 @@ public static function data_resizes_are_small_for_16bit_images() { * @ticket 63448 * @dataProvider data_png_color_type_after_resize * + * // Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. + * // See https://core.trac.wordpress.org/ticket/63932. + * @requires PHP < 8.3 + * * @param string $file_path Path to the image file. * @param int $expected_color_type The expected original color type. */ From 96e1c7ce43f431b7472db235219380bd18ec7214 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 4 Sep 2025 23:25:38 +0100 Subject: [PATCH 09/13] More skipping. --- tests/phpunit/tests/image/resize.php | 4 ++++ tests/phpunit/tests/media.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tests/phpunit/tests/image/resize.php b/tests/phpunit/tests/image/resize.php index e24cb9764e7e5..15b09bc76599c 100644 --- a/tests/phpunit/tests/image/resize.php +++ b/tests/phpunit/tests/image/resize.php @@ -96,6 +96,10 @@ public function test_resize_webp() { * Test resizing AVIF image. * * @ticket 51228 + * + * // Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. + * // See https://core.trac.wordpress.org/ticket/63932. + * @requires PHP < 8.3 */ public function test_resize_avif() { $file = DIR_TESTDATA . '/images/avif-lossy.avif'; diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php index 7c98cefcce45a..a52e6a0edc2e8 100644 --- a/tests/phpunit/tests/media.php +++ b/tests/phpunit/tests/media.php @@ -5472,6 +5472,10 @@ public function test_quality_with_image_conversion_file_sizes() { * Test AVIF quality filters. * * @ticket 61614 + * + * // Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. + * // See https://core.trac.wordpress.org/ticket/63932. + * @requires PHP < 8.3 */ public function test_quality_with_avif_conversion_file_sizes() { $temp_dir = get_temp_dir(); From 6855b34b726dbce553036cc8d4b3006fec3bc6f4 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Fri, 5 Sep 2025 15:25:09 +0100 Subject: [PATCH 10/13] Configure PHPUnit to fail on risky tests. --- phpunit.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ddbe4bd080ce1..4b5b0d3ded110 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,6 +6,7 @@ colors="true" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutOutputDuringTests="true" + failOnRisky="true" convertErrorsToExceptions="true" convertWarningsToExceptions="true" convertNoticesToExceptions="true" From 212facbd6666dec64a31805571161f6ce0661f1e Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 13 Sep 2025 12:38:12 +0100 Subject: [PATCH 11/13] I heard you like comments. --- tests/phpunit/tests/image/editorImagick.php | 12 ++++++------ tests/phpunit/tests/image/resize.php | 4 ++-- tests/phpunit/tests/media.php | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/phpunit/tests/image/editorImagick.php b/tests/phpunit/tests/image/editorImagick.php index 6bcfceefb4768..b5196ab9a284f 100644 --- a/tests/phpunit/tests/image/editorImagick.php +++ b/tests/phpunit/tests/image/editorImagick.php @@ -702,8 +702,8 @@ static function ( $value ) { * * @ticket 62285 * - * // Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. - * // See https://core.trac.wordpress.org/ticket/63932. + * Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. + * See https://core.trac.wordpress.org/ticket/63932. * @requires PHP < 8.3 */ public function test_image_max_bit_depth() { @@ -775,8 +775,8 @@ public function __return_eight() { * * @dataProvider data_resizes_are_small_for_16bit_images * - * // Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. - * // See https://core.trac.wordpress.org/ticket/63932. + * Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. + * See https://core.trac.wordpress.org/ticket/63932. * @requires PHP < 8.3 * * @param string $file Path to the image file. @@ -834,8 +834,8 @@ public static function data_resizes_are_small_for_16bit_images() { * @ticket 63448 * @dataProvider data_png_color_type_after_resize * - * // Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. - * // See https://core.trac.wordpress.org/ticket/63932. + * Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. + * See https://core.trac.wordpress.org/ticket/63932. * @requires PHP < 8.3 * * @param string $file_path Path to the image file. diff --git a/tests/phpunit/tests/image/resize.php b/tests/phpunit/tests/image/resize.php index 15b09bc76599c..999c9290ef1a5 100644 --- a/tests/phpunit/tests/image/resize.php +++ b/tests/phpunit/tests/image/resize.php @@ -97,8 +97,8 @@ public function test_resize_webp() { * * @ticket 51228 * - * // Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. - * // See https://core.trac.wordpress.org/ticket/63932. + * Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. + * See https://core.trac.wordpress.org/ticket/63932. * @requires PHP < 8.3 */ public function test_resize_avif() { diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php index a52e6a0edc2e8..b43869420dedb 100644 --- a/tests/phpunit/tests/media.php +++ b/tests/phpunit/tests/media.php @@ -5473,8 +5473,8 @@ public function test_quality_with_image_conversion_file_sizes() { * * @ticket 61614 * - * // Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. - * // See https://core.trac.wordpress.org/ticket/63932. + * Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. + * See https://core.trac.wordpress.org/ticket/63932. * @requires PHP < 8.3 */ public function test_quality_with_avif_conversion_file_sizes() { From 6dc436605c61949585f093529539bd4bba19e7d3 Mon Sep 17 00:00:00 2001 From: siliconforks Date: Sun, 7 Sep 2025 12:20:24 -0300 Subject: [PATCH 12/13] Skip PNG tests failing with ImageMagick 7 See https://core.trac.wordpress.org/ticket/63932 --- tests/phpunit/tests/image/editorImagick.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/phpunit/tests/image/editorImagick.php b/tests/phpunit/tests/image/editorImagick.php index b5196ab9a284f..3e8e04a9bef0e 100644 --- a/tests/phpunit/tests/image/editorImagick.php +++ b/tests/phpunit/tests/image/editorImagick.php @@ -783,6 +783,13 @@ public function __return_eight() { */ public function test_resizes_are_small_for_16bit_images( $file ) { + if ( DIR_TESTDATA . '/images/png-tests/test8.png' === $file ) { + $version = Imagick::getVersion(); + if ( $version['versionNumber'] >= 0x700 ) { + $this->markTestSkipped( 'ImageMagick 7 is unable to optimize grayscale images with 1-bit transparency.' ); + } + } + $temp_file = DIR_TESTDATA . '/images/test-temp.png'; $imagick_image_editor = new WP_Image_Editor_Imagick( $file ); @@ -843,6 +850,13 @@ public static function data_resizes_are_small_for_16bit_images() { */ public function test_png_color_type_is_preserved_after_resize( $file_path, $expected_color_type ) { + if ( DIR_TESTDATA . '/images/png-tests/test8.png' === $file_path ) { + $version = Imagick::getVersion(); + if ( $version['versionNumber'] >= 0x700 ) { + $this->markTestSkipped( 'ImageMagick 7 is unable to optimize grayscale images with 1-bit transparency.' ); + } + } + $temp_file = DIR_TESTDATA . '/images/test-temp.png'; $imagick_image_editor = new WP_Image_Editor_Imagick( $file_path ); From 3cf07698a927a0e1dc0f6fe2f5ccad9b391bbb2c Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 13 Sep 2025 12:42:23 +0100 Subject: [PATCH 13/13] Docs. --- tests/phpunit/tests/image/editorImagick.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/phpunit/tests/image/editorImagick.php b/tests/phpunit/tests/image/editorImagick.php index 3e8e04a9bef0e..33653a4078ba6 100644 --- a/tests/phpunit/tests/image/editorImagick.php +++ b/tests/phpunit/tests/image/editorImagick.php @@ -775,14 +775,11 @@ public function __return_eight() { * * @dataProvider data_resizes_are_small_for_16bit_images * - * Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. - * See https://core.trac.wordpress.org/ticket/63932. - * @requires PHP < 8.3 - * * @param string $file Path to the image file. */ public function test_resizes_are_small_for_16bit_images( $file ) { + // Temporarily disabled. See https://core.trac.wordpress.org/ticket/63932. if ( DIR_TESTDATA . '/images/png-tests/test8.png' === $file ) { $version = Imagick::getVersion(); if ( $version['versionNumber'] >= 0x700 ) { @@ -841,15 +838,12 @@ public static function data_resizes_are_small_for_16bit_images() { * @ticket 63448 * @dataProvider data_png_color_type_after_resize * - * Temporarily disabled until we can figure out why it fails on the Trixie based PHP container. - * See https://core.trac.wordpress.org/ticket/63932. - * @requires PHP < 8.3 - * * @param string $file_path Path to the image file. * @param int $expected_color_type The expected original color type. */ public function test_png_color_type_is_preserved_after_resize( $file_path, $expected_color_type ) { + // Temporarily disabled. See https://core.trac.wordpress.org/ticket/63932. if ( DIR_TESTDATA . '/images/png-tests/test8.png' === $file_path ) { $version = Imagick::getVersion(); if ( $version['versionNumber'] >= 0x700 ) {