-
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: add initial object cache support #55909
Conversation
Size Change: 0 B Total Size: 1.7 MB ℹ️ View Unchanged
|
Allows to run them even when Docker is not installed
Flaky tests detected in 5c0c146. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6785596724
|
jest.mock( 'child_process', () => { | ||
return { | ||
exec: jest.fn( Promise.resolve.bind( Promise ) ), | ||
execSync: jest.fn( () => 'Success!' ), | ||
}; | ||
} ); |
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.
This way tests can run even if Docker is not installed.
@@ -2,6 +2,7 @@ | |||
"core": "WordPress/WordPress", | |||
"plugins": [ "." ], | |||
"themes": [ "./test/emptytheme" ], | |||
"objectCache": "memcached", |
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.
Just for dogfooding, to remove before merge
To be honest, I'm not convinced that |
What?
Adds initial object cache support to
@wordpress/env
package throughmemcached
. No other object cache is supported at this point, though support could be added in the future.Fixes #55853
To-do
object-cache
service when checking out trunk. Maybe simply need to restart the env?Why?
Many large sites use a persistent external object cache. In order to test code with such a setup, it's important that wp-env supports an object cache as well. Especially useful for performance tests as well, to test code with and without object cache.
How?
A new
objectCache
enum config field can be used to select the type of object cache to setup. Currently supported values:null
/undefined
(default) - no object cachememcached
- uses memcache_d_If object cache is enabled, then:
object-cache
andtests-object-cache
services todocker-compose.yml
object-cache.php
drop-in towp-content/
Testing Instructions
Enable object cache support through
.wp-env.json
or.wp-env.override.json
like so:After that, run
wp-env start --update
Testing is needed especially with different PHP versions.
Testing Instructions for Keyboard
Screenshots or screencast