diff --git a/.github/workflows/e2e-test-plugin.yml b/.github/workflows/e2e-test-plugin.yml index 2863f868a..69ecb7bd3 100644 --- a/.github/workflows/e2e-test-plugin.yml +++ b/.github/workflows/e2e-test-plugin.yml @@ -40,6 +40,9 @@ jobs: - name: Maybe upgrade WP DB working-directory: plugins/faustwp run: docker exec --workdir=/var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) wp core update-db --allow-root + - name: Init Testing Environment + working-directory: plugins/faustwp + run: docker exec --workdir=/var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) init-testing-environment.sh - name: Install WP GraphQL working-directory: plugins/faustwp run: | diff --git a/plugins/faustwp/.docker/Dockerfile b/plugins/faustwp/.docker/Dockerfile index 42f2af39e..4acb728d7 100644 --- a/plugins/faustwp/.docker/Dockerfile +++ b/plugins/faustwp/.docker/Dockerfile @@ -11,6 +11,12 @@ ENV WP_VERSION=${WP_VERSION} # Needed for Codeception WPDB test integration. RUN docker-php-ext-install pdo pdo_mysql +# Install Dockerize +ENV DOCKERIZE_VERSION v0.7.0 +RUN curl -L -O https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz + # Install WP cli RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \ && chmod +x wp-cli.phar \ diff --git a/plugins/faustwp/.docker/scripts/init-testing-environment.sh b/plugins/faustwp/.docker/scripts/init-testing-environment.sh index f88e6e7bb..b48c8e8ec 100644 --- a/plugins/faustwp/.docker/scripts/init-testing-environment.sh +++ b/plugins/faustwp/.docker/scripts/init-testing-environment.sh @@ -5,6 +5,9 @@ version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; } +# Ensure mysql is loaded +dockerize -wait tcp://${WORDPRESS_DB_HOST}:3306 -timeout 1m + cd /var/www/html/wp-content/plugins/$WP_PLUGIN_FOLDER # Setup WordPress test core files and database