Open BrianHenryIE opened 3 years ago
In my project dir, I keep my plugin in a subdir (src) rather than the project root.
The next release of e2e-environment will have WC_E2E_FOLDER
which you would set to src
. In the interim you could create a package.json with all of your E2E packages in the src
folder and run all your E2E in that folder.
I'm going to leave this issue open for a reminder that we will need to update the instructions here when we release the e2e-environment package.
Additionally, I generally am writing a plugin around existing paid plugins that I need active. So I need to to symlink that plugin.
@BrianHenryIE I forgot to ask if there was a reason you can't install these with WP CLI in your initialization script?
From what I see, the only mapping into the host is WC_E2E_FOLDER_MAPPING
, so there's no way for me to point wp plugin install
to the plugin files. The key point being these are usually paid plugins, so are not available in the .org repo. So I don't know how!
The key point being these are usually paid plugins, so are not available in the .org repo. So I don't know how!
You can install and activate a plugin zip with wp plugin install /path/to/plugin.zip --activate
in your container initialization script.
Hi @BrianHenryIE,
Wanted to just follow up on this as it's been open a while. Did the option to try above work for you?
I had hoped the following would work but it fails at installing the WP CLI package.
wp package install wp-cli/dist-archive-command:dev-main
# List all folders in the plugin's (project) wp-content/plugins subfolder which are not symlinks or WooCommerce. Then create plugin archives for them.
find wp-content/plugins/bh-wc-disable-free-gifts-per-product/wp-content/plugins -depth 1 -type d ! -name 'woocommerce' ! -type l | xargs -n 1 -- bash -c 'wp dist-archive $0'
# List all .zip files in the plugin's (project) wp-content/plugins subfolder and install those plugins.
find wp-content/plugins/bh-wc-disable-free-gifts-per-product/wp-content/plugins -depth 1 -name '*.zip' | xargs -n 1 -- bash -c 'wp plugin install $0 --activate'
Error: Composer directory '/etc/X11/fs/.wp-cli/packages' for packages couldn't be created: mkdir(): Permission denied
I also seem to have to add || true
to the end of the wp user create customer ...
command in initialize.sh
or it causes a loop when the username already exists.
I'm looking for the best way to symlink multiple plugins from my project folder into the test environment.
docker-compose.yaml symlinks the plugin being tested with:
In my project dir, I keep my plugin in a subdir (src) rather than the project root.
Additionally, I generally am writing a plugin around existing paid plugins that I need active. So I need to to symlink that plugin.
Then I want to mock the API data I need in tests, which I'm doing in PHP with
WP_HTTP::request()
'spre_http_request
filter. Again, this plugin needs to be symlinked.I'm successfully doing this with a
package.json
postinstall
script:Is there a better way?