Skip to content
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

Temporary fix for wp-env database issue #19151

Merged
merged 7 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions projects/plugins/jetpack/changelog/fix-e2e-wp-env-failure
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Significance: patch
Type: compat
Comment: Temporary fix for E2E tests wp-env failure in WP 5.7 docker image.
1 change: 1 addition & 0 deletions projects/plugins/jetpack/tests/e2e/.wp-env.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"core": null,
"plugins": [ "./plugins/e2e-plan-data-interceptor.php" ],
"config": {
"WP_DEBUG": true,
Expand Down
3 changes: 2 additions & 1 deletion projects/plugins/jetpack/tests/e2e/bin/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ function usage {

start_env() {
yarn wp-env start
yarn wp-env run tests-wordpress sh wp-content/plugins/jetpack-dev/tests/e2e/bin/wp-setup.sh
configure_wp_env
}

Expand All @@ -23,6 +22,8 @@ reset_env() {
}

configure_wp_env() {
yarn wp-env run tests-wordpress sh wp-content/plugins/jetpack-dev/tests/e2e/bin/wp-setup.sh

if [ "$GUTENBERG" == "latest" ]; then
yarn wp-env run tests-cli wp plugin install gutenberg --activate
fi
Expand Down
7 changes: 7 additions & 0 deletions projects/plugins/jetpack/tests/e2e/bin/wp-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@

touch wp-content/debug.log
chown www-data:www-data wp-content/debug.log
chmod 755 wp-content/debug.log

# Remove default config entries
sed -i '/WP_SITEURL/d' wp-config.php
sed -i '/WP_HOME/d' wp-config.php
sed -i '/WP_TESTS_DOMAIN/d' wp-config.php
sed -i '/E2E_REQUEST_URL/d' wp-config.php

sed -i "/\/\* That's all, stop editing! Happy publishing. \*\//i\
define( 'E2E_REQUEST_URL', ( ! empty( \\\$_SERVER['HTTPS'] ) ? 'https://' : 'http://' ) . ( ! empty( \\\$_SERVER['HTTP_HOST'] ) ? \\\$_SERVER['HTTP_HOST'] : 'localhost' ) );\n\
Expand Down
2 changes: 1 addition & 1 deletion projects/plugins/jetpack/tests/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@babel/core": "7.12.10",
"@babel/preset-env": "7.12.11",
"@slack/web-api": "6.0.0",
"@wordpress/env": "1.6.0",
"@wordpress/env": "https://gitpkg.now.sh/WordPress/gutenberg/packages/env?trunk",
"@wordpress/eslint-plugin": "8.0.2",
"axios": "0.21.1",
"babel-jest": "26.6.3",
Expand Down
Loading