Avoid the test-data plugin occasionally missing in the E2E test environment #2286
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request:
Closes #2175
💡 The issue probably only happens on MacOS. Usually I can reproduce it after running the E2E tests 1-3 rounds.
Although I'm not fully confident this PR can fix it, after some time and validation, it seems to be working so far. The solution was mentioned by @mikkamp in #2080 (comment).
This PR:
.wp-env.json
file first as it was mixed with spaces and tabs.test-data.php
plugin have a dedicated directory and change to use theplugins
directive to set it up.Detailed test instructions:
💡 Considering the issue seems to only happen on MacOS, it would be more appropriate to have someone who uses the same OS or can reproduce the issue to review and test it.
npm run wp-env destroy
should not be necessary but it would be ideal to have a clean start to test it.npm run wp-env:up
to see if the E2E test env can be started without errors.npm run test:e2e
to see if all E2E tests can pass.Additional details:
📌 Investigation
Although I didn't find the exact cause, the process that led to the issue is roughly as follows.
wp-env
, it's shown there are nested mounts under the/var/www/html
directory.test-data.php
is mounted in the beginning.test-data.php
file is created back to the host side with 0 file size.test-data.php
is unmounted.(See the screenshot in step 3)
I couldn't find the same issue report, but I suspect the reason for this is similar to these past issues:
📌 About the
wp-cli.yml
filePlease note that the issue also happens on the
wp-cli.yml
file. If I understood it right, it's a one-time setup during initialization and won't break when thewp-cli.yml
file becomes unavailable. Therefore, this PR doesn't adjust it.google-listings-and-ads/tests/e2e/bin/test-env-setup.sh
Lines 9 to 10 in e6c03c1
Changelog entry