Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Update the wp-env package to latest (#3972)
Browse files Browse the repository at this point in the history
* update wp-env package

* bump versions in e2e workflows

* Fix job names

* explicitly set core WP version

without this, the `mappings` configuration option causes breakage due to what appears to be a bug in the package.

* Change how GB install job is setup

`wp-env` currently has an issue where if you define the explicit WP version to install (vs just what is included by default), permissions aren’t configured correctly for the WP folder in the containers. So the ability to install plugins via cli is not possible. This only surfaces in linux environments.

I tried a number of ways to work around this but in the end the only foolproof way is to configure the environment to be setup with the installed plugin.
  • Loading branch information
nerrad authored Mar 17, 2021
1 parent c46f247 commit 00f21f3
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 616 deletions.
39 changes: 19 additions & 20 deletions .github/workflows/php-js-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ jobs:
npm run test
JSE2ETestsWP56Gutenberg:
name: JavaScipt E2E Tests (WP 5.6 with Gutenberg plugin)
JSE2ETestsWP57Gutenberg:
name: JavaScipt E2E Tests (WP 5.7 with Gutenberg plugin)
needs: Setup
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -193,18 +193,20 @@ jobs:
run: |
composer install
- name: E2E Tests (WP 5.6 with Gutenberg plugin)
- name: E2E Tests (WP 5.7 with Gutenberg plugin)
env:
WOOCOMMERCE_BLOCKS_PHASE: 3
WP_VERSION: 5.6-branch
WP_VERSION: 5.7-branch
run: |
chmod -R 767 ./ #needed for permissions issues
JSON='{"plugins": ["https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip","https://github.com/WP-API/Basic-Auth/archive/master.zip","https://downloads.wordpress.org/plugin/gutenberg.latest-stable.zip", "."] }'
echo $JSON > .wp-env.override.json
npm run wp-env start
npm run wp-env clean all
npm run wp-env run tests-cli "wp plugin install gutenberg --activate"
npm run test:e2e
JSE2ETestsWP56:
name: JavaScipt E2E Tests (WP 5.6)
JSE2ETestsWP57:
name: JavaScipt E2E Tests (WP 5.7)
needs: Setup
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -258,19 +260,17 @@ jobs:
run: |
composer install
- name: E2E Tests (WP 5.6)
- name: E2E Tests (WP 5.7)
env:
WOOCOMMERCE_BLOCKS_PHASE: 3
WP_VERSION: 5.6-branch
WP_VERSION: 5.7-branch
run: |
JSON='{"core": "WordPress/WordPress#'"$WP_VERSION"'"}'
echo $JSON > .wp-env.override.json
npm run wp-env start
npm run wp-env clean all
npm run test:e2e
JSE2ETestsWP55:
name: JavaScipt E2E Tests (WP 5.5)
JSE2ETestsWP56:
name: JavaScipt E2E Tests (WP 5.6)
needs: Setup
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -324,19 +324,19 @@ jobs:
run: |
composer install
- name: E2E Tests (WP 5.5)
- name: E2E Tests (WP 5.6)
env:
WOOCOMMERCE_BLOCKS_PHASE: 3
WP_VERSION: 5.5-branch
WP_VERSION: 5.6-branch
run: |
JSON='{"core": "WordPress/WordPress#'"$WP_VERSION"'"}'
echo $JSON > .wp-env.override.json
npm run wp-env start
npm run wp-env clean all
npm run test:e2e
JSE2ETestsWP54:
name: JavaScipt E2E Tests (WP 5.4)
JSE2ETestsWP55:
name: JavaScipt E2E Tests (WP 5.5)
needs: Setup
runs-on: ubuntu-latest
steps:
Expand All @@ -363,7 +363,6 @@ jobs:
- name: Npm install and build
run: |
npm ci
npm install @wordpress/[email protected]
FORCE_REDUCED_MOTION=true npm run build:e2e-test
- name: blocks.ini setup
Expand Down Expand Up @@ -391,10 +390,10 @@ jobs:
run: |
composer install
- name: E2E Tests (WP 5.4)
- name: E2E Tests (WP 5.5)
env:
WOOCOMMERCE_BLOCKS_PHASE: 3
WP_VERSION: 5.4-branch
WP_VERSION: 5.5-branch
run: |
JSON='{"core": "WordPress/WordPress#'"$WP_VERSION"'"}'
echo $JSON > .wp-env.override.json
Expand Down
1 change: 1 addition & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"core": "WordPress/WordPress#5.7-branch",
"plugins": [
"https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip",
"https://github.com/WP-API/Basic-Auth/archive/master.zip",
Expand Down
Loading

0 comments on commit 00f21f3

Please sign in to comment.