From 73ad5616290997e1971ee5bcbc090c342028f867 Mon Sep 17 00:00:00 2001 From: Kevin Porras Date: Wed, 19 Oct 2022 11:01:47 -0600 Subject: [PATCH 1/2] Do nothing for WP + Behat. --- wp/.ci/test/behat/cleanup | 37 +----------------------------------- wp/.ci/test/behat/initialize | 30 +---------------------------- wp/.ci/test/behat/run | 30 +---------------------------- 3 files changed, 3 insertions(+), 94 deletions(-) diff --git a/wp/.ci/test/behat/cleanup b/wp/.ci/test/behat/cleanup index 1d80ae3..19d7369 100755 --- a/wp/.ci/test/behat/cleanup +++ b/wp/.ci/test/behat/cleanup @@ -6,39 +6,4 @@ set -eo pipefail # This script runs cleanup after Behat tests complete. # -# Authenticate with Terminus -terminus -n auth:login --machine-token="$TERMINUS_TOKEN" - -# Restore the DB backup made before testing -terminus -n backup:restore $TERMINUS_SITE.$TERMINUS_ENV --element=database --yes - -# Check if an admin user with our desired username exists -BEHAT_ADMIN_USER_EXISTS=$(terminus -n wp ${TERMINUS_SITE}.${TERMINUS_ENV} -- user list --login=${BEHAT_ADMIN_USERNAME} --format=count) - -# If so, delete the existing admin user -if [[ "$BEHAT_ADMIN_USER_EXISTS" == "1" ]] -then - terminus -n wp $TERMINUS_SITE.$TERMINUS_ENV -- user delete $BEHAT_ADMIN_USERNAME --yes -fi - -# Clear site cache -terminus -n env:clear-cache $TERMINUS_SITE.$TERMINUS_ENV - -# Store artifacts -export ARTIFACTS_DIR_URL="${CI_BUILD_URL}/artifacts/${CI_NODE_INDEX}/artifacts" - -# Create the artifacts directory if needed -if [ ! -d "$ARTIFACTS_FULL_DIR" ]; then - mkdir -p $ARTIFACTS_FULL_DIR -fi - - -# Copy behat-screenshots files to ARTIFACTS_FULL_DIR -echo -e "\nCopying behat-screenshots files to $ARTIFACTS_FULL_DIR..." -if [ -d "$ARTIFACTS_FULL_DIR/behat-screenshots" ]; then - rm -rf $ARTIFACTS_FULL_DIR/behat-screenshots -fi - -if [ -d behat-screenshots ]; then - cp -r behat-screenshots $ARTIFACTS_FULL_DIR/ -fi \ No newline at end of file +# Do nothing as Behat is no longer supported in WP. \ No newline at end of file diff --git a/wp/.ci/test/behat/initialize b/wp/.ci/test/behat/initialize index a816f67..d9d4584 100755 --- a/wp/.ci/test/behat/initialize +++ b/wp/.ci/test/behat/initialize @@ -7,32 +7,4 @@ set -eo pipefail # needed to run Behat tests. # -# Authenticate with Terminus -terminus -n auth:login --machine-token="$TERMINUS_TOKEN" - -# Run composer install again to get dev dependencies -composer install --no-ansi --no-interaction --optimize-autoloader --no-progress - -# Wake the multidev environment before running tests -terminus -n env:wake $TERMINUS_SITE.$TERMINUS_ENV - -# Ping wp-cli to start ssh with the app server -terminus -n wp $TERMINUS_SITE.$TERMINUS_ENV -- cli version - -# Check if an admin user with our desired username exists -BEHAT_ADMIN_USER_EXISTS=$(terminus -n wp ${TERMINUS_SITE}.${TERMINUS_ENV} -- user list --login=${BEHAT_ADMIN_USERNAME} --format=count) - -# If so, delete the existing admin user -if [[ "$BEHAT_ADMIN_USER_EXISTS" == "1" ]] -then - terminus -n wp $TERMINUS_SITE.$TERMINUS_ENV -- user delete $BEHAT_ADMIN_USERNAME --yes -fi - -# Update WordPress database -terminus -n wp $TERMINUS_SITE.$TERMINUS_ENV -- core update-db - -# Create a backup before running Behat tests -terminus -n backup:create $TERMINUS_SITE.$TERMINUS_ENV - -# Clear the environment cache -terminus -n env:clear-cache $TERMINUS_SITE.$TERMINUS_ENV \ No newline at end of file +# Do nothing as Behat is no longer supported in WP. \ No newline at end of file diff --git a/wp/.ci/test/behat/run b/wp/.ci/test/behat/run index 635e2f3..8483c7e 100755 --- a/wp/.ci/test/behat/run +++ b/wp/.ci/test/behat/run @@ -4,32 +4,4 @@ # This script runs the Behat tests. # -# Authenticate with Terminus -terminus -n auth:login --machine-token="$TERMINUS_TOKEN" - -# Source $BASH_ENV -source $BASH_ENV - -# Dynamically set Behat configuration parameters -export BEHAT_PARAMS='{"extensions":{"Behat\\MinkExtension":{"base_url":"https://'$TERMINUS_ENV'-'$TERMINUS_SITE'.pantheonsite.io"},"PaulGibbs\\WordpressBehatExtension":{"site_url":"https://'$TERMINUS_ENV'-'$TERMINUS_SITE'.pantheonsite.io/wp","users":{"admin":{"username":"'$BEHAT_ADMIN_USERNAME'","password":"'$BEHAT_ADMIN_PASSWORD'"}},"wpcli":{"binary":"terminus -n wp '$TERMINUS_SITE'.'$TERMINUS_ENV' --"}}}}' - -# Set Behat variables from environment variables -export RELOCATED_WP_ADMIN=TRUE - -# Create the desired admin user -terminus -n wp $TERMINUS_SITE.$TERMINUS_ENV -- user create $BEHAT_ADMIN_USERNAME $BEHAT_ADMIN_EMAIL --user_pass=$BEHAT_ADMIN_PASSWORD --role=administrator - -# Verbose mode and exit on errors -set -ex - -# Start headless Chrome -echo "\n Starting Chrome in headless mode ..." -google-chrome --disable-gpu --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --no-sandbox /dev/null & - -echo "::::::::::::::::::::::::::::::::::::::::::::::::" -echo "Behat test site: $TERMINUS_SITE.$TERMINUS_ENV" -echo "::::::::::::::::::::::::::::::::::::::::::::::::" -echo - -# Run the Behat tests -./vendor/bin/behat --config=tests/behat/behat-pantheon.yml --strict --colors "$@" +# Do nothing as Behat is no longer supported in WP. \ No newline at end of file From 5f952cc72d00bfbb34ac97131dd34144abdca551 Mon Sep 17 00:00:00 2001 From: Kevin Porras Date: Mon, 19 Dec 2022 07:06:05 -0600 Subject: [PATCH 2/2] Change docker image and add safe.directory for github actions. --- .../bitbucket-pipelines/bitbucket-pipelines.yml | 2 +- d9/providers/circleci/.circleci/config.yml | 2 +- .../.ci/.github/workflows/build_deploy_and_test.yml | 10 ++++++---- .../.ci/.github/workflows/scheduled_update_check.yml | 2 +- d9/providers/gitlab-pipelines/.gitlab-ci.yml | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/d9/providers/bitbucket-pipelines/bitbucket-pipelines.yml b/d9/providers/bitbucket-pipelines/bitbucket-pipelines.yml index a38ae4c..c62a667 100644 --- a/d9/providers/bitbucket-pipelines/bitbucket-pipelines.yml +++ b/d9/providers/bitbucket-pipelines/bitbucket-pipelines.yml @@ -88,7 +88,7 @@ default_steps: &default_steps artifacts: - behat-screenshots/** -image: quay.io/pantheon-public/build-tools-ci:8.x-php7.4 +image: quay.io/pantheon-public/build-tools-ci:8.x-php8.1 options: max-time: 30 diff --git a/d9/providers/circleci/.circleci/config.yml b/d9/providers/circleci/.circleci/config.yml index d6bfe57..9599a01 100644 --- a/d9/providers/circleci/.circleci/config.yml +++ b/d9/providers/circleci/.circleci/config.yml @@ -1,7 +1,7 @@ # https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs defaults: &defaults docker: - - image: quay.io/pantheon-public/build-tools-ci:8.x-php7.4 + - image: quay.io/pantheon-public/build-tools-ci:8.x-php8.1 working_directory: ~/example_drops_8_composer environment: #========================================================================= diff --git a/d9/providers/githubactions/.ci/.github/workflows/build_deploy_and_test.yml b/d9/providers/githubactions/.ci/.github/workflows/build_deploy_and_test.yml index 4634947..098f24b 100644 --- a/d9/providers/githubactions/.ci/.github/workflows/build_deploy_and_test.yml +++ b/d9/providers/githubactions/.ci/.github/workflows/build_deploy_and_test.yml @@ -25,7 +25,7 @@ env: jobs: configure_env_vars: container: - image: quay.io/pantheon-public/build-tools-ci:8.x-php7.4 + image: quay.io/pantheon-public/build-tools-ci:8.x-php8.1 options: --user root runs-on: ubuntu-latest steps: @@ -78,7 +78,7 @@ jobs: static_tests: container: - image: quay.io/pantheon-public/build-tools-ci:8.x-php7.4 + image: quay.io/pantheon-public/build-tools-ci:8.x-php8.1 options: --user root runs-on: ubuntu-latest steps: @@ -113,7 +113,7 @@ jobs: deploy_to_pantheon: container: - image: quay.io/pantheon-public/build-tools-ci:8.x-php7.4 + image: quay.io/pantheon-public/build-tools-ci:8.x-php8.1 options: --user root runs-on: ubuntu-latest needs: [configure_env_vars, static_tests] @@ -190,11 +190,13 @@ jobs: eval `ssh-agent -s` ssh-add ../private.key source $BASH_ENV + # Fix any dubious ownership error. + git config --global --add safe.directory $GITHUB_WORKSPACE ./.ci/deploy/pantheon/dev-multidev behat_test: container: - image: quay.io/pantheon-public/build-tools-ci:8.x-php7.4 + image: quay.io/pantheon-public/build-tools-ci:8.x-php8.1 options: --user root runs-on: ubuntu-latest continue-on-error: true diff --git a/d9/providers/githubactions/.ci/.github/workflows/scheduled_update_check.yml b/d9/providers/githubactions/.ci/.github/workflows/scheduled_update_check.yml index ef5669f..0938942 100644 --- a/d9/providers/githubactions/.ci/.github/workflows/scheduled_update_check.yml +++ b/d9/providers/githubactions/.ci/.github/workflows/scheduled_update_check.yml @@ -26,7 +26,7 @@ env: jobs: scheduled_update_check: container: - image: quay.io/pantheon-public/build-tools-ci:8.x-php7.4 + image: quay.io/pantheon-public/build-tools-ci:8.x-php8.1 options: --user root runs-on: ubuntu-latest steps: diff --git a/d9/providers/gitlab-pipelines/.gitlab-ci.yml b/d9/providers/gitlab-pipelines/.gitlab-ci.yml index 02c0556..a88741c 100644 --- a/d9/providers/gitlab-pipelines/.gitlab-ci.yml +++ b/d9/providers/gitlab-pipelines/.gitlab-ci.yml @@ -1,5 +1,5 @@ # Build tools Dockerfile -image: quay.io/pantheon-public/build-tools-ci:8.x-php7.4 +image: quay.io/pantheon-public/build-tools-ci:8.x-php8.1 # Default Variables variables: