Skip to content

Commit

Permalink
Remove behat from wordpress
Browse files Browse the repository at this point in the history
  • Loading branch information
namespacebrian committed Feb 29, 2024
1 parent 5e63f94 commit 2f4393b
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 230 deletions.
9 changes: 0 additions & 9 deletions wp/.ci/test/behat/cleanup

This file was deleted.

10 changes: 0 additions & 10 deletions wp/.ci/test/behat/initialize

This file was deleted.

7 changes: 0 additions & 7 deletions wp/.ci/test/behat/run

This file was deleted.

22 changes: 1 addition & 21 deletions wp/providers/bitbucket-pipelines/bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,26 +81,6 @@ default_steps: &default_steps
- ./.ci/test/visual-regression/run
artifacts:
- backstop_data/**
- step:
name: Test Behat
services:
- docker
caches:
- docker
- composer
script:
- *bash_env_export
- *bash_env_source
- ./.ci/test/behat/initialize
# Start headless Chrome
- google-chrome --disable-gpu --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --no-sandbox </dev/null &>/dev/null &
- ./.ci/test/behat/run
after-script:
- *bash_env_export
- *bash_env_source
- ./.ci/test/behat/cleanup
artifacts:
- behat-screenshots/**

image: quay.io/pantheon-public/build-tools-ci:8.x-php7.4

Expand Down Expand Up @@ -131,4 +111,4 @@ pipelines:
- export CI_PROJECT_NAME=$BITBUCKET_REPO_FULL_NAME && echo $CI_PROJECT_NAME
- /build-tools-ci/scripts/set-environment
- terminus -n auth:login --machine-token="$TERMINUS_TOKEN"
- set -e && terminus project:clu $TERMINUS_SITE
- set -e && terminus project:clu $TERMINUS_SITE
48 changes: 3 additions & 45 deletions wp/providers/circleci/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ defaults: &defaults
# ADMIN_EMAIL: The email address to give the admin when installing.
#=========================================================================
TZ: "/usr/share/zoneinfo/America/Los_Angeles"

# The variables below usually do not need to be modified.

#======================================================================================================================================
# Circle CI 2.0 does not yet expand environment variables so they have to be manually EXPORTed
# Once environment variables can be expanded the variables below can be uncommented and the EXPORTs in set-up-globals.sh can be removed
# See: https://discuss.circleci.com/t/unclear-how-to-work-with-user-variables-circleci-provided-env-variables/12810/11
# See: https://discuss.circleci.com/t/environment-variable-expansion-in-working-directory/11322
# See: https://discuss.circleci.com/t/circle-2-0-global-environment-variables/8681
#======================================================================================================================================

NOTIFY: 'scripts/github/add-commit-comment {project} {sha} "Created multidev environment [{site}#{env}]({dashboard-url})." {site-url}'
ADMIN_USERNAME: admin
TERM: dumb
Expand Down Expand Up @@ -146,44 +146,6 @@ jobs:
name: deploy to Pantheon
command: ./.ci/deploy/pantheon/dev-multidev

behat_test:
<<: *defaults
steps:
- checkout

- restore_cache:
keys:
- composer-cache-{{ checksum "composer.lock" }}
- composer-cache-

- run:
# Set TERMINUS_ENV and related environment variables.
# https://github.com/pantheon-systems/docker-build-tools-ci/blob/6.x/scripts/set-environment
name: setup-environment-vars
command: /build-tools-ci/scripts/set-environment

- run:
name: prepare for Behat testing
command: ./.ci/test/behat/initialize

- run:
name: run acceptance tests with Behat
command: ./.ci/test/behat/run

- run:
name: clean up after Behat
command: ./.ci/test/behat/cleanup
when: always

- save_cache:
key: composer-cache-{{ checksum "composer.lock" }}
paths:
- $HOME/.composer/cache

- store_artifacts:
path: /tmp/artifacts
destination: artifacts

visual_regression_test:
<<: *defaults
docker:
Expand Down Expand Up @@ -247,10 +209,6 @@ workflows:
branches:
ignore:
- master
- behat_test:
requires:
- deploy_to_pantheon
- visual_regression_test

scheduled_update_check:
triggers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,118 +251,14 @@ jobs:
source $BASH_ENV
./.ci/deploy/pantheon/dev-multidev
behat_test:
container:
image: quay.io/pantheon-public/build-tools-ci:8.x-php7.4
options: --user root
runs-on: ubuntu-latest
continue-on-error: true
needs: [deploy_to_pantheon]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref || github.ref_name }}

- name: Set bash_env env var
run: echo BASH_ENV=${RUNNER_TEMP}/bash_env.txt >> $GITHUB_ENV

- name: Cache bash_env.txt
uses: actions/cache@v3
env:
cache-name: cache-bash-env
with:
path: ${{ env.BASH_ENV }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.run_number }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache composer cache
uses: actions/cache@v3
env:
cache-name: cache-composer-cache
with:
path: ~/.composer/cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache vendor folder
uses: actions/cache@v3
env:
cache-name: cache-vendor
with:
path: ./vendor
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}

- name: Cache web folder
uses: actions/cache@v3
env:
cache-name: cache-web
with:
path: ./web
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.run_number }}

- name: Cache drush folder
uses: actions/cache@v3
env:
cache-name: cache-drush
with:
path: ./drush
key: ${{ runner.os }}-build-${{ env.cache-name }}

# Set TERMINUS_ENV and related environment variables.
# https://github.com/pantheon-systems/docker-build-tools-ci/blob/6.x/scripts/set-environment
- name: setup-environment-vars
run: /build-tools-ci/scripts/set-environment

# Uncomment line 26 in .ci/test/behat/initialize to create a backup
# prior to running Behat tests. This is useful to reset the multidev
# environment to the previous state after Behat tests have run.
- name: prepare for Behat testing
run: |
echo "$SSH_PRIVATE_KEY" > ../private.key
chmod 600 ../private.key
eval `ssh-agent -s`
ssh-add ../private.key
source $BASH_ENV
./.ci/test/behat/initialize
- name: run acceptance tests with Behat
run: |
eval `ssh-agent -s`
ssh-add ../private.key
./.ci/test/behat/run
# Uncomment line 13 in .ci/test/behat/cleanup to restore a backup
# after running Behat tests. This is useful to reset the multidev
# environment to the previous state after Behat tests have run.
- name: clean up after Behat
if: ${{ always() }}
run: |
eval `ssh-agent -s`
ssh-add ../private.key
source $BASH_ENV
./.ci/test/behat/cleanup
- name: Upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: behat-report
path: /tmp/artifacts
visual_regression_test:
container:
image: backstopjs/backstopjs:6.1.0
options: --user root
runs-on: ubuntu-latest
if: ${{ github.ref != 'refs/heads/master' }}
needs: [configure_env_vars, behat_test]
needs: [configure_env_vars]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
34 changes: 1 addition & 33 deletions wp/providers/gitlab-pipelines/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ stages:
- configure-and-build
- deploy
- visual-test
- behat-test
- cleanup
- updates

Expand Down Expand Up @@ -114,7 +113,7 @@ deploy:multidev:

test:visual-regression:
stage: visual-test
image:
image:
name: backstopjs/backstopjs:4.1.9
entrypoint: [""]
variables:
Expand All @@ -139,37 +138,6 @@ test:visual-regression:
except:
- schedules

test:behat:
stage: behat-test
script:
- ./.ci/test/behat/initialize
# Start headless Chrome
- google-chrome --disable-gpu --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --no-sandbox </dev/null &>/dev/null &
- ./.ci/test/behat/run
artifacts:
paths:
- behat-screenshots
dependencies:
- test:visual-regression
only:
- merge_requests
- master
except:
- schedules

test:behat:cleanup:
stage: cleanup
when: always
script:
- ./.ci/test/behat/cleanup
only:
- merge_requests
- master
except:
- schedules
dependencies:
- test:behat

schedule:composer:update:
stage: updates
script:
Expand Down

0 comments on commit 2f4393b

Please sign in to comment.