-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Env: Bind "core" files to tests environment #21195
Env: Bind "core" files to tests environment #21195
Conversation
When using a local source for "core" we want to ensure two things: 1. That changes the user makes within the "core" directory are served in both the development and tests environments. 2. That the development and tests environment use separate databases and `wp-content/uploads`. Only (2) was working because the tests environment served everything from a totally separate copy of WordPress. The fix is to bind every file except wp-config.php and wp-content from the local "core" directory to the tests environment.
Size Change: 0 B Total Size: 856 kB ℹ️ View Unchanged
|
// https://github.com/WordPress/gutenberg/issues/21164 | ||
`${ config.coreSource.testsPath }:/var/www/html`, | ||
...fs | ||
.readdirSync( config.coreSource.path ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like how buildDockerComposeConfig
has become an "impure" function.
OK, I'm happy with this.
I tested this and all seems gucci 👌. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this with my local dev env, and running e2e tests on core now works 🎉
I also tested a few of the custom configs documented on the env package readme and they built successfully.
Code looks good.
Fixes #21164.
When using a local source for "core" we want to ensure two things:
wp-content/uploads
.Only (2) was working because the tests environment served everything from a totally separate copy of WordPress.
The fix is to bind every file except
wp-config.php
andwp-content
from the local "core" directory to the tests environment.To test:
Create a
.wp-env.json
that has its"core"
set to a local path:Run
wp-env start
.Make changes to something in
wordpress-develop/build
.The changes should appear in both
localhost:8888
andlocalhost:8889
.We should also verify that this does not break existing flows, e.g. running
wp-env start
with"core": null
and"core: "WordPress/WordPress"
.