From 98289049e58d051869eb2a05f6683f05d22f8e42 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 11 Dec 2024 15:05:44 -0300 Subject: [PATCH 1/4] Fix the debug-bar-elasticpress dependency of ElasticPress --- .wp-env.json | 1 - bin/setup-cypress-env.sh | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.wp-env.json b/.wp-env.json index fad3bc4ab..c102b17dd 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -13,7 +13,6 @@ ".", "https://downloads.wordpress.org/plugin/classic-widgets.zip", "https://downloads.wordpress.org/plugin/debug-bar.zip", - "https://downloads.wordpress.org/plugin/debug-bar-elasticpress.zip", "https://downloads.wordpress.org/plugin/wordpress-importer.zip", "10up/elasticpress-proxy#develop" ], diff --git a/bin/setup-cypress-env.sh b/bin/setup-cypress-env.sh index f0d80487a..62b8e3526 100755 --- a/bin/setup-cypress-env.sh +++ b/bin/setup-cypress-env.sh @@ -57,6 +57,11 @@ fi # Set twentytwentyone as the active theme here, as 2025 won't work with WP 6.0 ./bin/wp-env-cli tests-wordpress "wp --allow-root theme activate twentytwentyone" +# Fix the debug-bar-elasticpress dependency of ElasticPress +./bin/wp-env-cli tests-wordpress "wp --allow-root plugin install debug-bar-elasticpress" +sed -i "s/Requires Plugins: elasticpress/Requires Plugins: $PLUGIN_NAME" /var/www/html/wp-content/plugins/debug-bar-elasticpress/debug-bar-elasticpress.php +./bin/wp-env-cli tests-wordpress "wp --allow-root plugin activate debug-bar-elasticpress" + if [ ! -z $WP_VERSION ]; then ./bin/wp-env-cli tests-wordpress "wp --allow-root core update --version=${WP_VERSION} --force" fi From 522527e592f1b9117fe014e1d5fe8d6d4e9792ec Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 11 Dec 2024 15:23:33 -0300 Subject: [PATCH 2/4] Fix the sed call --- bin/setup-cypress-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/setup-cypress-env.sh b/bin/setup-cypress-env.sh index 62b8e3526..be307af2d 100755 --- a/bin/setup-cypress-env.sh +++ b/bin/setup-cypress-env.sh @@ -59,7 +59,7 @@ fi # Fix the debug-bar-elasticpress dependency of ElasticPress ./bin/wp-env-cli tests-wordpress "wp --allow-root plugin install debug-bar-elasticpress" -sed -i "s/Requires Plugins: elasticpress/Requires Plugins: $PLUGIN_NAME" /var/www/html/wp-content/plugins/debug-bar-elasticpress/debug-bar-elasticpress.php +sed -i "s/Requires Plugins: elasticpress/Requires Plugins: $PLUGIN_NAME/" /var/www/html/wp-content/plugins/debug-bar-elasticpress/debug-bar-elasticpress.php ./bin/wp-env-cli tests-wordpress "wp --allow-root plugin activate debug-bar-elasticpress" if [ ! -z $WP_VERSION ]; then From 2eef4ee1c275d81928875e5ca2a79b34c40700ab Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 11 Dec 2024 15:48:02 -0300 Subject: [PATCH 3/4] Run sed inside wp-env container --- bin/setup-cypress-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/setup-cypress-env.sh b/bin/setup-cypress-env.sh index be307af2d..4e93e4342 100755 --- a/bin/setup-cypress-env.sh +++ b/bin/setup-cypress-env.sh @@ -59,7 +59,7 @@ fi # Fix the debug-bar-elasticpress dependency of ElasticPress ./bin/wp-env-cli tests-wordpress "wp --allow-root plugin install debug-bar-elasticpress" -sed -i "s/Requires Plugins: elasticpress/Requires Plugins: $PLUGIN_NAME/" /var/www/html/wp-content/plugins/debug-bar-elasticpress/debug-bar-elasticpress.php +./bin/wp-env-cli tests-wordpress "sed -i ""s/Requires Plugins: elasticpress/Requires Plugins: $PLUGIN_NAME/"" /var/www/html/wp-content/plugins/debug-bar-elasticpress/debug-bar-elasticpress.php" ./bin/wp-env-cli tests-wordpress "wp --allow-root plugin activate debug-bar-elasticpress" if [ ! -z $WP_VERSION ]; then From a726b1bb31b6df47f1afa75ec4631090d4a4979d Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 11 Dec 2024 15:52:41 -0300 Subject: [PATCH 4/4] Escape sed call --- bin/setup-cypress-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/setup-cypress-env.sh b/bin/setup-cypress-env.sh index 4e93e4342..8332cb9b7 100755 --- a/bin/setup-cypress-env.sh +++ b/bin/setup-cypress-env.sh @@ -59,7 +59,7 @@ fi # Fix the debug-bar-elasticpress dependency of ElasticPress ./bin/wp-env-cli tests-wordpress "wp --allow-root plugin install debug-bar-elasticpress" -./bin/wp-env-cli tests-wordpress "sed -i ""s/Requires Plugins: elasticpress/Requires Plugins: $PLUGIN_NAME/"" /var/www/html/wp-content/plugins/debug-bar-elasticpress/debug-bar-elasticpress.php" +./bin/wp-env-cli tests-wordpress "sed -i \"s/Requires Plugins: elasticpress/Requires Plugins: $PLUGIN_NAME/\" /var/www/html/wp-content/plugins/debug-bar-elasticpress/debug-bar-elasticpress.php" ./bin/wp-env-cli tests-wordpress "wp --allow-root plugin activate debug-bar-elasticpress" if [ ! -z $WP_VERSION ]; then