Commit 2ec00ec8001 for woocommerce
commit 2ec00ec80012c1af5884f68af47dad7e48860019
Author: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
Date: Thu Jun 18 14:35:31 2026 +0200
Fix E2E helper plugin mounts (#65807)
diff --git a/plugins/woocommerce/.wp-env.json b/plugins/woocommerce/.wp-env.json
index 12e08bc946c..63f0990d80b 100644
--- a/plugins/woocommerce/.wp-env.json
+++ b/plugins/woocommerce/.wp-env.json
@@ -29,12 +29,7 @@
"ALTERNATE_WP_CRON": false
},
"mappings": {
- "wp-cli.yml": "./tests/wp-cli.yml",
- "test-env-setup.sh": "./tests/e2e-pw/bin/test-env-setup.sh",
- "wp-content/plugins/filter-setter.php": "./tests/e2e-pw/bin/filter-setter.php",
- "wp-content/plugins/process-waiting-actions.php": "./tests/e2e-pw/bin/process-waiting-actions.php",
- "wp-content/plugins/test-helper-apis.php": "./tests/e2e-pw/bin/test-helper-apis.php",
- "wp-content/plugins/custom-place-order-button-test.php": "./tests/e2e-pw/test-plugins/blocks/custom-place-order-button-test.php",
+ "wp-content/plugins/e2e-test-helpers": "./tests/e2e-pw/bin",
"test-data/images/": "./tests/e2e-pw/test-data/images/",
"wp-content/themes/emptytheme": "./tests/e2e-pw/themes/blocks/emptytheme",
"wp-content/themes/theme-with-woo-templates": "./tests/e2e-pw/themes/blocks/theme-with-woo-templates",
diff --git a/plugins/woocommerce/changelog/fix-e2e-helper-plugin-mounts b/plugins/woocommerce/changelog/fix-e2e-helper-plugin-mounts
new file mode 100644
index 00000000000..b31e64db61b
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-e2e-helper-plugin-mounts
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Mount E2E helper plugins as a directory and provision wp-cli.yml in-container so single-file Docker mounts no longer surface as empty files under gRPC FUSE.
diff --git a/plugins/woocommerce/tests/e2e-pw/bin/blocks/test-env-setup.sh b/plugins/woocommerce/tests/e2e-pw/bin/blocks/test-env-setup.sh
index cf88237bff3..14e2466a18d 100755
--- a/plugins/woocommerce/tests/e2e-pw/bin/blocks/test-env-setup.sh
+++ b/plugins/woocommerce/tests/e2e-pw/bin/blocks/test-env-setup.sh
@@ -21,7 +21,7 @@ $prefs["core/edit-site"]["welcomeGuideTemplate"] = false;
update_user_meta( 1, "wp_persisted_preferences", $prefs );
'
# Activate the Test Helper APIs utility plugin.
-wp-env run tests-cli -- wp plugin activate test-helper-apis
+wp-env run tests-cli -- wp plugin activate e2e-test-helpers/test-helper-apis.php
echo "Generating test translations"
node $script_dir/generate-test-translations.js
diff --git a/plugins/woocommerce/tests/e2e-pw/bin/test-env-setup.sh b/plugins/woocommerce/tests/e2e-pw/bin/test-env-setup.sh
index e28ed4a890f..4e918b27712 100755
--- a/plugins/woocommerce/tests/e2e-pw/bin/test-env-setup.sh
+++ b/plugins/woocommerce/tests/e2e-pw/bin/test-env-setup.sh
@@ -4,7 +4,9 @@ if [ ! -z ${CI+y} ]; then
# In CI we want to execute the setup behind single container call, while in dev-environments we use the script as it is.
# Inside the container the command executed from /var/www/html path as pwd
echo -e '--> Dispatching script execution into tests-cli\n'
- wp-env run --debug tests-cli cp test-env-setup.sh test-env-setup-ci.sh
+ # Source from the e2e-test-helpers directory mount; a single-file mount of this
+ # script can surface as an empty file under Docker gRPC FUSE.
+ wp-env run --debug tests-cli cp wp-content/plugins/e2e-test-helpers/test-env-setup.sh test-env-setup-ci.sh
wp-env run --debug tests-cli sed -i -e 's/wp-env run tests-cli //' test-env-setup-ci.sh
wp-env run --debug tests-cli bash test-env-setup-ci.sh
exit $?
@@ -16,19 +18,26 @@ wp-env run tests-cli wp theme install storefront twentytwenty twentytwentytwo &
echo -e 'Activate default theme \n'
wp-env run tests-cli wp theme activate twentytwentythree
+# Provision wp-cli.yml in-container instead of mapping it. Single-file Docker
+# mounts can surface as empty files under gRPC FUSE, which would silently drop
+# the apache_modules declaration that `wp rewrite ... --hard` needs to write the
+# mod_rewrite block to .htaccess.
+echo -e 'Provision wp-cli.yml \n'
+wp-env run tests-cli bash -c 'printf "apache_modules:\n - mod_rewrite\n" > /var/www/html/wp-cli.yml'
+
echo -e 'Update URL structure \n'
wp-env run tests-cli wp rewrite structure '/%postname%/' --hard
echo -e 'Activate Filter Setter utility plugin \n'
-wp-env run tests-cli wp plugin activate filter-setter
+wp-env run tests-cli wp plugin activate e2e-test-helpers/filter-setter.php
# This plugin allows you to process queued scheduled actions immediately.
# It's used in the analytics e2e tests so that order numbers are shown in Analytics.
echo -e 'Activate Process Waiting Actions utility plugin \n'
-wp-env run tests-cli wp plugin activate process-waiting-actions
+wp-env run tests-cli wp plugin activate e2e-test-helpers/process-waiting-actions.php
echo -e 'Activate Test Helper APIs utility plugin \n'
-wp-env run tests-cli wp plugin activate test-helper-apis
+wp-env run tests-cli wp plugin activate e2e-test-helpers/test-helper-apis.php
echo -e 'Install Plugin-check utility plugin \n'
wp-env run tests-cli wp plugin install plugin-check --activate
diff --git a/plugins/woocommerce/tests/e2e-pw/tests/checkout/checkout-shortcode-custom-place-order-button.spec.ts b/plugins/woocommerce/tests/e2e-pw/tests/checkout/checkout-shortcode-custom-place-order-button.spec.ts
index e6bfa522743..de322232394 100644
--- a/plugins/woocommerce/tests/e2e-pw/tests/checkout/checkout-shortcode-custom-place-order-button.spec.ts
+++ b/plugins/woocommerce/tests/e2e-pw/tests/checkout/checkout-shortcode-custom-place-order-button.spec.ts
@@ -22,7 +22,9 @@ const test = baseTest.extend( {
await createClassicCheckoutPage();
// Activating the custom place order button test plugin (mapped in .wp-env.json).
- await wpCLI( 'wp plugin activate custom-place-order-button-test' );
+ await wpCLI(
+ 'wp plugin activate woocommerce-blocks-test-plugins/custom-place-order-button-test.php'
+ );
// The custom plugin comes with a custom gateway - enabling it through CLI to simplify our lives.
await wpCLI(
diff --git a/plugins/woocommerce/tests/wp-cli.yml b/plugins/woocommerce/tests/wp-cli.yml
deleted file mode 100644
index 3cf7565b3bc..00000000000
--- a/plugins/woocommerce/tests/wp-cli.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-apache_modules:
- - mod_rewrite