Skip to content

Commit

Permalink
Merge pull request #25 from pantheon-systems/bugs-5651
Browse files Browse the repository at this point in the history
[BUGS-5651] PHP 8.1 and fix for dubious folder in Github Actions.
  • Loading branch information
kporras07 authored Jan 3, 2023
2 parents 2e03e67 + 5f952cc commit 107e193
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 102 deletions.
2 changes: 1 addition & 1 deletion d9/providers/bitbucket-pipelines/bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion d9/providers/circleci/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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:
#=========================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion d9/providers/gitlab-pipelines/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
37 changes: 1 addition & 36 deletions wp/.ci/test/behat/cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -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
# Do nothing as Behat is no longer supported in WP.
30 changes: 1 addition & 29 deletions wp/.ci/test/behat/initialize
Original file line number Diff line number Diff line change
Expand Up @@ -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
# Do nothing as Behat is no longer supported in WP.
30 changes: 1 addition & 29 deletions wp/.ci/test/behat/run
Original file line number Diff line number Diff line change
Expand Up @@ -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 &>/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.

0 comments on commit 107e193

Please sign in to comment.