-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Replace wp-scripts env usage with wp-env in CI. #20280
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cf8ce46
Update e2e tests to use wp-env when run in travis
talldan 03ed63c
Use wp command
talldan b5f8ea1
Use quotes around command to pass to docker container
talldan 48e803a
Set script debug to false
talldan 172d59b
Try chmod on the uploads folder
talldan 8a66380
Adding missing .
talldan a9ad63f
Remove duplicate wp-env start commands
talldan 4991431
Ensure PHP binary is defined
talldan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,44 +53,13 @@ install: | |
- npm run build | ||
- | | ||
if [[ "$INSTALL_WORDPRESS" = "true" ]]; then | ||
# Download and unpack WordPress. | ||
curl -sL https://github.com/WordPress/WordPress/archive/master.zip -o /tmp/wordpress-latest.zip | ||
unzip -q /tmp/wordpress-latest.zip -d /tmp | ||
mkdir -p wordpress/src | ||
mv /tmp/WordPress-master/* wordpress/src | ||
|
||
# Create the upload directory with permissions that Travis can handle. | ||
mkdir -p wordpress/src/wp-content/uploads | ||
chmod 767 wordpress/src/wp-content/uploads | ||
|
||
# Grab the tools we need for WordPress' local-env. | ||
curl -sL https://github.com/WordPress/wordpress-develop/archive/master.zip -o /tmp/wordpress-develop.zip | ||
unzip -q /tmp/wordpress-develop.zip -d /tmp | ||
mv \ | ||
/tmp/wordpress-develop-master/tools \ | ||
/tmp/wordpress-develop-master/tests \ | ||
/tmp/wordpress-develop-master/.env \ | ||
/tmp/wordpress-develop-master/docker-compose.yml \ | ||
/tmp/wordpress-develop-master/wp-cli.yml \ | ||
/tmp/wordpress-develop-master/*config-sample.php \ | ||
/tmp/wordpress-develop-master/package.json wordpress | ||
|
||
# Install WordPress. The additional dependencies are required by the copied `wordpress-develop` tools. | ||
cd wordpress | ||
npm install dotenv wait-on | ||
npm run env:start | ||
sleep 10 | ||
npm run env:install | ||
cd .. | ||
|
||
# Connect Gutenberg to WordPress. | ||
npm run env connect | ||
npm run env cli plugin activate gutenberg | ||
echo '{ "config": { "SCRIPT_DEBUG": false } }' > .wp-env.override.json | ||
npm run wp-env start | ||
fi | ||
- | | ||
if [[ "$E2E_ROLE" = "author" ]]; then | ||
npm run env cli -- user create author [email protected] --role=author --user_pass=authpass | ||
npm run env cli -- post update 1 --post_author=2 | ||
npm run wp-env run tests-cli "wp user create author [email protected] --role=author --user_pass=authpass" | ||
npm run wp-env run tests-cli "wp post update 1 --post_author=2" | ||
fi | ||
|
||
jobs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Should we chmod more broadly to allow other things to have write access (e.g. chmod all of
wp-content
)? See some discussion around #22454 (comment) in which a PHP test doesn't have access to what it wantsThis may also remove the need for a different
chmod
I added in .travis.yml for the PHP test stepsThere 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.
That seems like a good call. I can put together a separate PR to cover it.