From e88ef9ce571f0425393a3d3bc98f19a8e54f7f23 Mon Sep 17 00:00:00 2001 From: Jason Bahl Date: Mon, 19 Jul 2021 10:37:51 -0600 Subject: [PATCH 1/7] - update install-test-env.sh - add .env.dist --- .env.dist | 31 ++++++++++++++++++++ .github/workflows/upload-schema-artifact.yml | 2 +- bin/install-test-env.sh | 20 +++++-------- 3 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 .env.dist diff --git a/.env.dist b/.env.dist new file mode 100644 index 0000000..ec17662 --- /dev/null +++ b/.env.dist @@ -0,0 +1,31 @@ +DB_NAME=wordpress +DB_HOST=app_db +DB_USER=wordpress +DB_PASSWORD=wordpress +WP_TABLE_PREFIX=wp_ +WP_URL=http://localhost +WP_DOMAIN=localhost +ADMIN_EMAIL=admin@example.com +ADMIN_USERNAME=admin +ADMIN_PASSWORD=password +ADMIN_PATH=/wp-admin + +TEST_DB_NAME=wpgraphql_acf_tests +TEST_DB_HOST=127.0.0.1 +TEST_DB_USER=wordpress +TEST_DB_PASSWORD=wordpress +TEST_WP_TABLE_PREFIX=wp_ + +SKIP_DB_CREATE=false +TEST_WP_ROOT_FOLDER=/tmp/wordpress +TEST_ADMIN_EMAIL=admin@wp.test + +TESTS_DIR=tests +TESTS_OUTPUT=tests/_output +TESTS_DATA=tests/_data +TESTS_SUPPORT=tests/_support +TESTS_ENVS=tests/_envs + +#WPGRAPHQL_VERSION=v1.3.3 +SKIP_TESTS_CLEANUP=1 +SUITES=wpunit diff --git a/.github/workflows/upload-schema-artifact.yml b/.github/workflows/upload-schema-artifact.yml index 0ce08ba..be2a814 100644 --- a/.github/workflows/upload-schema-artifact.yml +++ b/.github/workflows/upload-schema-artifact.yml @@ -1,4 +1,4 @@ -name: Schema Linter +name: Schema Artifact on: workflow_dispatch: diff --git a/bin/install-test-env.sh b/bin/install-test-env.sh index 66890d1..3eda692 100644 --- a/bin/install-test-env.sh +++ b/bin/install-test-env.sh @@ -1,10 +1,16 @@ #!/usr/bin/env bash +if [[ ! -f ".env" ]]; then + echo "No .env file was detected. .env.dist has been copied to .env" + echo "Open the .env file and enter values to match your local environment" + cp .env.dist .env +fi + source .env print_usage_instruction() { echo "Ensure that .env file exist in project root directory exists." - echo "And run the following 'composer install-wp-tests' in the project root directory" + echo "And run the following 'composer build-test' in the project root directory" exit 1 } @@ -142,19 +148,10 @@ install_db() { configure_wordpress() { cd $WP_CORE_DIR wp config create --dbname="$DB_NAME" --dbuser="$DB_USER" --dbpass="$DB_PASS" --dbhost="$DB_HOST" --skip-check --force=true - wp core install --url=wp.test --title="WPGraphQL ACF Tests" --admin_user=admin --admin_password=password --admin_email=admin@wp.test + wp core install --url=wp.test --title="WPGraphQL Tests" --admin_user=admin --admin_password=password --admin_email=admin@wp.test wp rewrite structure '/%year%/%monthnum%/%postname%/' } -install_acf_pro() { - if [ ! -d $WP_CORE_DIR/wp-content/plugins/advanced-custom-fields-pro ]; then - echo "Cloning ACF PRO" - git clone https://github.com/wp-premium/advanced-custom-fields-pro.git $WP_CORE_DIR/wp-content/plugins/advanced-custom-fields-pro - fi - echo "Cloning ACF PRO" - wp plugin activate advanced-custom-fields-pro -} - setup_plugin() { # Add this repo as a plugin to the repo if [ ! -d $WP_CORE_DIR/wp-content/plugins/wp-graphql-acf ]; then @@ -190,5 +187,4 @@ setup_plugin() { install_wp install_db configure_wordpress -install_acf_pro setup_plugin From e11c5a8893a87d9d9ccd208212175fabe7e8d818 Mon Sep 17 00:00:00 2001 From: Jason Bahl Date: Mon, 19 Jul 2021 10:59:43 -0600 Subject: [PATCH 2/7] - remove .env --- .env | 31 ------------------------------- bin/install-test-env.sh | 11 +++++++++++ 2 files changed, 11 insertions(+), 31 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index ec17662..0000000 --- a/.env +++ /dev/null @@ -1,31 +0,0 @@ -DB_NAME=wordpress -DB_HOST=app_db -DB_USER=wordpress -DB_PASSWORD=wordpress -WP_TABLE_PREFIX=wp_ -WP_URL=http://localhost -WP_DOMAIN=localhost -ADMIN_EMAIL=admin@example.com -ADMIN_USERNAME=admin -ADMIN_PASSWORD=password -ADMIN_PATH=/wp-admin - -TEST_DB_NAME=wpgraphql_acf_tests -TEST_DB_HOST=127.0.0.1 -TEST_DB_USER=wordpress -TEST_DB_PASSWORD=wordpress -TEST_WP_TABLE_PREFIX=wp_ - -SKIP_DB_CREATE=false -TEST_WP_ROOT_FOLDER=/tmp/wordpress -TEST_ADMIN_EMAIL=admin@wp.test - -TESTS_DIR=tests -TESTS_OUTPUT=tests/_output -TESTS_DATA=tests/_data -TESTS_SUPPORT=tests/_support -TESTS_ENVS=tests/_envs - -#WPGRAPHQL_VERSION=v1.3.3 -SKIP_TESTS_CLEANUP=1 -SUITES=wpunit diff --git a/bin/install-test-env.sh b/bin/install-test-env.sh index 3eda692..2892aa7 100644 --- a/bin/install-test-env.sh +++ b/bin/install-test-env.sh @@ -152,6 +152,16 @@ configure_wordpress() { wp rewrite structure '/%year%/%monthnum%/%postname%/' } +install_acf_pro() { + if [ ! -d $WP_CORE_DIR/wp-content/plugins/advanced-custom-fields-pro ]; then + echo "Cloning ACF PRO" + git clone https://github.com/wp-premium/advanced-custom-fields-pro.git $WP_CORE_DIR/wp-content/plugins/advanced-custom-fields-pro + fi + echo "Cloning ACF PRO" + wp plugin activate advanced-custom-fields-pro +} + + setup_plugin() { # Add this repo as a plugin to the repo if [ ! -d $WP_CORE_DIR/wp-content/plugins/wp-graphql-acf ]; then @@ -187,4 +197,5 @@ setup_plugin() { install_wp install_db configure_wordpress +install_acf_pro setup_plugin From 2fb3c32003bfd10569850a5660ca53d107ab8261 Mon Sep 17 00:00:00 2001 From: Jason Bahl Date: Mon, 19 Jul 2021 11:17:06 -0600 Subject: [PATCH 3/7] - update docker files --- bin/install-test-env.sh | 1 - docker-compose.yml | 2 +- docker/app.Dockerfile | 22 ++++++---- docker/app.entrypoint.sh | 85 ++---------------------------------- docker/app.post-setup.sh | 15 +++++++ docker/app.setup.sh | 42 ++++++++++++++++++ docker/testing.Dockerfile | 15 +++---- docker/testing.entrypoint.sh | 38 +++++++++++----- 8 files changed, 109 insertions(+), 111 deletions(-) create mode 100644 docker/app.post-setup.sh create mode 100644 docker/app.setup.sh diff --git a/bin/install-test-env.sh b/bin/install-test-env.sh index 2892aa7..495dbbd 100644 --- a/bin/install-test-env.sh +++ b/bin/install-test-env.sh @@ -161,7 +161,6 @@ install_acf_pro() { wp plugin activate advanced-custom-fields-pro } - setup_plugin() { # Add this repo as a plugin to the repo if [ ! -d $WP_CORE_DIR/wp-content/plugins/wp-graphql-acf ]; then diff --git a/docker-compose.yml b/docker-compose.yml index 03ea775..877582b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: local: app_db: - image: mysql:5.7 + image: mariadb:10.2 environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: wordpress diff --git a/docker/app.Dockerfile b/docker/app.Dockerfile index 4e0872e..3d03c66 100644 --- a/docker/app.Dockerfile +++ b/docker/app.Dockerfile @@ -1,12 +1,19 @@ ############################################################################### -# Pre-configured WordPress Installation w/ WPGraphQL, WPGraphQL for ACF, ACF Pro # +# Pre-configured WordPress Installation w/ WPGraphQL, WPGatsby # # For testing only, use in production not recommended. # ############################################################################### + +# Use build args to get the right wordpress + php image ARG WP_VERSION ARG PHP_VERSION FROM wordpress:${WP_VERSION}-php${PHP_VERSION}-apache +# Needed to specify the build args again after the FROM command. +ARG WP_VERSION +ARG PHP_VERSION + +# Save the build args for use by the runtime environment ENV WP_VERSION=${WP_VERSION} ENV PHP_VERSION=${PHP_VERSION} @@ -39,13 +46,9 @@ RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli # Set project environmental variables ENV WP_ROOT_FOLDER="/var/www/html" -ENV WORDPRESS_DB_HOST=${DB_HOST} -ENV WORDPRESS_DB_USER=${DB_USER} -ENV WORDPRESS_DB_PASSWORD=${DB_PASSWORD} -ENV WORDPRESS_DB_NAME=${DB_NAME} ENV PLUGINS_DIR="${WP_ROOT_FOLDER}/wp-content/plugins" -ENV PROJECT_DIR="${PLUGINS_DIR}/wp-graphql-acf" -ENV WPGRAPHQL_VERSION="${WPGRAPHQL_VERSION}" +ENV PROJECT_DIR="${PLUGINS_DIR}/wp-graphql" +ENV DATA_DUMP_DIR="${PROJECT_DIR}/tests/_data" # Remove exec statement from base entrypoint script. RUN sed -i '$d' /usr/local/bin/docker-entrypoint.sh @@ -66,13 +69,16 @@ RUN echo "Installing XDebug 3 (in disabled state)" \ && echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/disabled/docker-php-ext-xdebug.ini \ && echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/disabled/docker-php-ext-xdebug.ini \ && echo "xdebug.client_port=9003" >> /usr/local/etc/php/conf.d/disabled/docker-php-ext-xdebug.ini \ + && echo "xdebug.max_nesting_level=512" >> /usr/local/etc/php/conf.d/disabled/docker-php-ext-xdebug.ini \ ; # Set xdebug configuration off by default. See the entrypoint.sh. -ENV USING_XDEBUG=${USING_XDEBUG} +ENV USING_XDEBUG=0 # Set up entrypoint WORKDIR /var/www/html +COPY docker/app.setup.sh /usr/local/bin/app-setup.sh +COPY docker/app.post-setup.sh /usr/local/bin/app-post-setup.sh COPY docker/app.entrypoint.sh /usr/local/bin/app-entrypoint.sh RUN chmod 755 /usr/local/bin/app-entrypoint.sh ENTRYPOINT ["app-entrypoint.sh"] diff --git a/docker/app.entrypoint.sh b/docker/app.entrypoint.sh index 1a06d4c..3af289a 100644 --- a/docker/app.entrypoint.sh +++ b/docker/app.entrypoint.sh @@ -1,86 +1,7 @@ #!/bin/bash -if [ "$USING_XDEBUG" == "1" ]; then - echo "Enabling XDebug 3" - mv /usr/local/etc/php/conf.d/disabled/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/ -fi - -# Run WordPress docker entrypoint. -. docker-entrypoint.sh 'apache2' - -set +u - -# Ensure mysql is loaded -dockerize -wait tcp://${DB_HOST}:${DB_HOST_PORT:-3306} -timeout 1m - -# Config WordPress -if [ ! -f "${WP_ROOT_FOLDER}/wp-config.php" ]; then - wp config create \ - --path="${WP_ROOT_FOLDER}" \ - --dbname="${DB_NAME}" \ - --dbuser="${DB_USER}" \ - --dbpass="${DB_PASSWORD}" \ - --dbhost="${DB_HOST}" \ - --dbprefix="${WP_TABLE_PREFIX}" \ - --skip-check \ - --quiet \ - --allow-root -fi - -# Install WP if not yet installed -if ! $( wp core is-installed --allow-root ); then - wp core install \ - --path="${WP_ROOT_FOLDER}" \ - --url="${WP_URL}" \ - --title='Test' \ - --admin_user="${ADMIN_USERNAME}" \ - --admin_password="${ADMIN_PASSWORD}" \ - --admin_email="${ADMIN_EMAIL}" \ - --allow-root -fi - -# Install and activate WPGraphQL - -echo "wpgraphql version... ${WPGRAPHQL_VERSION}" -echo "${PLUGINS_DIR}" - -if [ ! -f "${PLUGINS_DIR}/wp-graphql/wp-graphql.php" ]; then - # WPGRAPHQL_VERSION in format like v1.2.3 - echo ${WPGRAPHQL_VERSION} - if [[ -z ${WPGRAPHQL_VERSION} ]]; then - echo "installing latest WPGraphQL from WordPress.org" - wp plugin install wp-graphql --activate --allow-root - else - echo "Installing WPGraphQL from Github" - git clone https://github.com/wp-graphql/wp-graphql.git "${PLUGINS_DIR}/wp-graphql" - cd "${PLUGINS_DIR}/wp-graphql" - echo "checking out WPGraphQL tag/${WPGRAPHQL_VERSION}" - git checkout tags/${WPGRAPHQL_VERSION} -b master - composer install --no-dev - cd ${WP_ROOT_FOLDER} - echo "activating WPGraphQL" - wp plugin activate wp-graphql --allow-root - wp plugin list --allow-root - fi -else - wp plugin activate wp-graphql --allow-root -fi - -# Install and activate ACF Pro -if [ ! -f "${PLUGINS_DIR}/advanced-custom-fields-pro/acf.php" ]; then - wp plugin install \ - https://github.com/wp-premium/advanced-custom-fields-pro/archive/master.zip \ - --activate --allow-root -else - wp plugin activate advanced-custom-fields-pro --allow-root -fi - -# Install and activate WPGatsby -wp plugin activate wp-graphql-acf --allow-root - -# Set pretty permalinks. -wp rewrite structure '/%year%/%monthnum%/%postname%/' --allow-root - -wp db export "${PROJECT_DIR}/tests/_data/dump.sql" --allow-root +# Run app setup script. +. app-setup.sh +. app-post-setup.sh exec "$@" diff --git a/docker/app.post-setup.sh b/docker/app.post-setup.sh new file mode 100644 index 0000000..f577bd8 --- /dev/null +++ b/docker/app.post-setup.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Activate wp-graphql +wp plugin activate wp-graphql --allow-root + +# Set pretty permalinks. +wp rewrite structure '/%year%/%monthnum%/%postname%/' --allow-root + +wp db export "${DATA_DUMP_DIR}/dump.sql" --allow-root + +# If maintenance mode is active, de-activate it +if $( wp maintenance-mode is-active --allow-root ); then + echo "Deactivating maintenance mode" + wp maintenance-mode deactivate --allow-root +fi diff --git a/docker/app.setup.sh b/docker/app.setup.sh new file mode 100644 index 0000000..93b0c9f --- /dev/null +++ b/docker/app.setup.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +if [ "$USING_XDEBUG" == "1" ]; then + echo "Enabling XDebug 3" + mv /usr/local/etc/php/conf.d/disabled/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/ +fi + +# Run WordPress docker entrypoint. +. docker-entrypoint.sh 'apache2' + +set +u + +# Ensure mysql is loaded +dockerize -wait tcp://${DB_HOST}:${DB_HOST_PORT:-3306} -timeout 1m + +# Config WordPress +if [ ! -f "${WP_ROOT_FOLDER}/wp-config.php" ]; then + wp config create \ + --path="${WP_ROOT_FOLDER}" \ + --dbname="${DB_NAME}" \ + --dbuser="${DB_USER}" \ + --dbpass="${DB_PASSWORD}" \ + --dbhost="${DB_HOST}" \ + --dbprefix="${WP_TABLE_PREFIX}" \ + --skip-check \ + --quiet \ + --allow-root +fi + +# Install WP if not yet installed +if ! $( wp core is-installed --allow-root ); then + wp core install \ + --path="${WP_ROOT_FOLDER}" \ + --url="${WP_URL}" \ + --title='Test' \ + --admin_user="${ADMIN_USERNAME}" \ + --admin_password="${ADMIN_PASSWORD}" \ + --admin_email="${ADMIN_EMAIL}" \ + --allow-root +fi + +echo "Running WordPress version: $(wp core version --allow-root) at $(wp option get home --allow-root)" diff --git a/docker/testing.Dockerfile b/docker/testing.Dockerfile index cdec274..891c22f 100644 --- a/docker/testing.Dockerfile +++ b/docker/testing.Dockerfile @@ -2,8 +2,10 @@ # Container for running Codeception tests on a WPGraphQL Docker instance. # ############################################################################ -# Using the 'DESIRED_' prefix to avoid confusion with environment variables of the same name. -FROM wpgraphql-acf-app:latest +ARG WP_VERSION +ARG PHP_VERSION + +FROM wp-graphql:latest-wp${WP_VERSION}-php${PHP_VERSION} LABEL author=jasonbahl LABEL author_uri=https://github.com/jasonbahl @@ -18,8 +20,8 @@ RUN docker-php-ext-install pdo_mysql RUN apt-get install zip unzip -y \ && pecl install pcov -ENV COVERAGE=0 -ENV SUITES=${SUITES:-zz} +ENV COVERAGE= +ENV SUITES=${SUITES:-} # Install composer ENV COMPOSER_ALLOW_SUPERUSER=1 @@ -34,11 +36,8 @@ ENV PATH "$PATH:~/.composer/vendor/bin" # Configure php RUN echo "date.timezone = UTC" >> /usr/local/etc/php/php.ini -# Remove exec statement from base entrypoint script. -RUN sed -i '$d' /usr/local/bin/app-entrypoint.sh - # Set up entrypoint -WORKDIR /var/www/html/wp-content/plugins/wp-graphql-acf +WORKDIR /var/www/html COPY docker/testing.entrypoint.sh /usr/local/bin/testing-entrypoint.sh RUN chmod 755 /usr/local/bin/testing-entrypoint.sh ENTRYPOINT ["testing-entrypoint.sh"] diff --git a/docker/testing.entrypoint.sh b/docker/testing.entrypoint.sh index d812b6b..9bd316e 100644 --- a/docker/testing.entrypoint.sh +++ b/docker/testing.entrypoint.sh @@ -1,5 +1,7 @@ #!/bin/bash +echo "WordPress: ${WP_VERSION} PHP: ${PHP_VERSION}" + # Processes parameters and runs Codeception. run_tests() { if [[ -n "$COVERAGE" ]]; then @@ -15,10 +17,16 @@ run_tests() { exit 1 fi - for suite in $suites ; do - echo "Running Test Suite $suite" - vendor/bin/codecept run -c codeception.dist.yml ${suite} ${coverage:-} ${debug:-} --no-exit - done + # If maintenance mode is active, de-activate it + if $( wp maintenance-mode is-active --allow-root ); then + echo "Deactivating maintenance mode" + wp maintenance-mode deactivate --allow-root + fi + + + # Suites is the comma separated list of suites/tests to run. + echo "Running Test Suite $suites" + vendor/bin/codecept run -c codeception.dist.yml "${suites}" ${coverage:-} ${debug:-} --no-exit } # Exits with a status of 0 (true) if provided version number is higher than proceeding numbers. @@ -40,17 +48,25 @@ RewriteRule . /index.php [L] # Move to WordPress root folder workdir="$PWD" -echo "Moving to WordPress root directory." +echo "Moving to WordPress root directory ${WP_ROOT_FOLDER}." cd ${WP_ROOT_FOLDER} -# Run app entrypoint script. -. app-entrypoint.sh +# Because we are starting apache independetly of the docker image, +# we set WORDPRESS environment variables so apache see them and used in the wp-config.php +echo "export WORDPRESS_DB_HOST=${WORDPRESS_DB_HOST}" >> /etc/apache2/envvars +echo "export WORDPRESS_DB_USER=${WORDPRESS_DB_USER}" >> /etc/apache2/envvars +echo "export WORDPRESS_DB_PASSWORD=${WORDPRESS_DB_PASSWORD}" >> /etc/apache2/envvars +echo "export WORDPRESS_DB_NAME=${WORDPRESS_DB_NAME}" >> /etc/apache2/envvars + +# Run app setup scripts. +. app-setup.sh +. app-post-setup.sh write_htaccess # Return to PWD. -echo "Moving back to project working directory." -cd ${workdir} +echo "Moving back to project working directory ${PROJECT_DIR}" +cd ${PROJECT_DIR} # Ensure Apache is running service apache2 start @@ -78,8 +94,8 @@ if version_gt $PHP_VERSION 7.0 && [[ -n "$COVERAGE" ]] && [[ -z "$USING_XDEBUG" echo "Using pcov/clobber for codecoverage" docker-php-ext-enable pcov echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini - echo "pcov.directory = /var/www/html/wp-content/plugins/wp-graphql" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini - COMPOSER_MEMORY_LIMIT=-1 composer require --dev pcov/clobber + echo "pcov.directory = ${PROJECT_DIR}" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini + COMPOSER_MEMORY_LIMIT=-1 composer require pcov/clobber --dev vendor/bin/pcov clobber elif [[ -n "$COVERAGE" ]] && [[ -n "$USING_XDEBUG" ]]; then echo "Using XDebug for codecoverage" From 84b7bd9887993ceb812a0e3665bc142ed0bfdb6c Mon Sep 17 00:00:00 2001 From: Jason Bahl Date: Mon, 19 Jul 2021 11:23:57 -0600 Subject: [PATCH 4/7] - update docker files --- .env.dist | 6 ++++++ bin/install-test-env.sh | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.env.dist b/.env.dist index ec17662..dedf78c 100644 --- a/.env.dist +++ b/.env.dist @@ -29,3 +29,9 @@ TESTS_ENVS=tests/_envs #WPGRAPHQL_VERSION=v1.3.3 SKIP_TESTS_CLEANUP=1 SUITES=wpunit + +WORDPRESS_DB_HOST=${DB_HOST} +WORDPRESS_DB_USER=${DB_USER} +WORDPRESS_DB_PASSWORD=${DB_PASSWORD} +WORDPRESS_DB_NAME=${DB_NAME} +WORDPRESS_TABLE_PREFIX=${WP_TABLE_PREFIX} diff --git a/bin/install-test-env.sh b/bin/install-test-env.sh index 495dbbd..c879c57 100644 --- a/bin/install-test-env.sh +++ b/bin/install-test-env.sh @@ -35,7 +35,7 @@ TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//") WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib} WP_CORE_DIR=${TEST_WP_ROOT_FOLDER-$TMPDIR/wordpress/} PLUGIN_DIR=$(pwd) -DB_SERVE_NAME=${DB_SERVE_NAME-wpgatsby_serve} +DB_SERVE_NAME=${DB_SERVE_NAME-wpgraphql_acf_serve} SKIP_DB_CREATE=${SKIP_DB_CREATE-false} download() { @@ -148,7 +148,7 @@ install_db() { configure_wordpress() { cd $WP_CORE_DIR wp config create --dbname="$DB_NAME" --dbuser="$DB_USER" --dbpass="$DB_PASS" --dbhost="$DB_HOST" --skip-check --force=true - wp core install --url=wp.test --title="WPGraphQL Tests" --admin_user=admin --admin_password=password --admin_email=admin@wp.test + wp core install --url=wp.test --title="WPGraphQL for ACF Tests" --admin_user=admin --admin_password=password --admin_email=admin@wp.test wp rewrite structure '/%year%/%monthnum%/%postname%/' } From d25deb61098a64cb388b08bec5b2bbc947773516 Mon Sep 17 00:00:00 2001 From: Jason Bahl Date: Mon, 19 Jul 2021 11:38:35 -0600 Subject: [PATCH 5/7] - output env variables --- bin/install-test-env.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/install-test-env.sh b/bin/install-test-env.sh index c879c57..65ff329 100644 --- a/bin/install-test-env.sh +++ b/bin/install-test-env.sh @@ -138,6 +138,8 @@ install_db() { fi fi + env | sort + # create database RESULT=`mysql -u $DB_USER --password="$DB_PASS" --skip-column-names -e "SHOW DATABASES LIKE '$DB_NAME'"$EXTRA` if [ "$RESULT" != $DB_NAME ]; then From e9fb8ebf1bb5f7210da271e67f29cc0fd20140e3 Mon Sep 17 00:00:00 2001 From: Jason Bahl Date: Mon, 19 Jul 2021 13:36:22 -0600 Subject: [PATCH 6/7] - output the env vars --- bin/install-test-env.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/install-test-env.sh b/bin/install-test-env.sh index 65ff329..6a4bc2a 100644 --- a/bin/install-test-env.sh +++ b/bin/install-test-env.sh @@ -8,6 +8,8 @@ fi source .env +env | sort + print_usage_instruction() { echo "Ensure that .env file exist in project root directory exists." echo "And run the following 'composer build-test' in the project root directory" From 114da2bbdd28224672bff6870e466c969c4c8f44 Mon Sep 17 00:00:00 2001 From: Jason Bahl Date: Mon, 19 Jul 2021 13:38:36 -0600 Subject: [PATCH 7/7] - output the env vars --- bin/install-test-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install-test-env.sh b/bin/install-test-env.sh index 6a4bc2a..c256bfc 100644 --- a/bin/install-test-env.sh +++ b/bin/install-test-env.sh @@ -6,7 +6,7 @@ if [[ ! -f ".env" ]]; then cp .env.dist .env fi -source .env +source .env.dist env | sort