Skip to content

Commit

Permalink
[ECP-8654] Clean up Workflow Files & Add Support For Express Checkout (
Browse files Browse the repository at this point in the history
…#2303)

* Rename workflow and update target branch

* Rename express checkout workflow

* Skip installation of developer module in pipeline until ECP-8686 is resolved

* Update bot usernames

* Parametrize E2E script

* Add comment

* Unmount redundant path

* Update workflow with parameters

* Point default branch to develop

* Remove redundant comments

* Edit run name

* Remove redundant conditional

* Remove dev module setup, update name, enable run conditional

* Update target branch for tests as develop

---------

Co-authored-by: Cenk Kucukiravul <[email protected]>
  • Loading branch information
cenkiravul and Cenk Kucukiravul authored Oct 24, 2023
1 parent af84fb3 commit 2454b7f
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 91 deletions.
1 change: 0 additions & 1 deletion .github/docker-compose.e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ services:

volumes:
- ../../scripts/e2e.sh:/e2e.sh
- ../../scripts/e2e-all.sh:/e2e-all.sh
- ../../../test-report:/tmp/test-report
15 changes: 0 additions & 15 deletions .github/scripts/e2e-all.sh

This file was deleted.

35 changes: 24 additions & 11 deletions .github/scripts/e2e.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
#!/bin/bash
set -euo pipefail

# Checkout E2E tests
cd /tmp;
git clone https://github.com/Adyen/adyen-integration-tools-tests.git;
cd adyen-integration-tools-tests;
git checkout $INTEGRATION_TESTS_BRANCH;
# Base configuration and installation
set -euo pipefail
cd /tmp
git clone https://github.com/Adyen/adyen-integration-tools-tests.git
cd adyen-integration-tools-tests
git checkout $INTEGRATION_TESTS_BRANCH
rm -rf package-lock.json
npm i

# Setup environment
rm -rf package-lock.json;
npm i;
option="$1"

# Run tests
npm run test:ci:magento
# Run the desired group of tests
case $option in
"standard")
echo "Running Standard Set of E2E Tests."
npm run test:ci:magento
;;
"express-checkout")
echo "Running Express Checkout E2E Tests."
npm run test:ci:magento:express-checkout
;;
"all")
echo "Running All Magento E2E Tests"
npm run test:ci:magento:all
;;
esac
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@ on:
testBranch:
description: "Integration Test Repository Pipeline"
required: true
default: "develop-9"
default: "develop"
expressBranch:
description: "Express Checkout Repository Pipeline"
required: true
default: "rc-v2"

jobs:
build:
if: |
${{
github.event.pull_request.draft == false &&
(github.actor != 'renovate' || github.actor != 'lgtm-com')
}}
runs-on:
group: larger-runners
labels: ubuntu-latest-8-cores
Expand Down Expand Up @@ -88,7 +83,7 @@ jobs:
run: docker exec magento2-container make fs

- name: Run E2E tests
run: docker-compose -f .github/workflows/templates/docker-compose.yml run --rm playwright /e2e-all.sh
run: docker-compose -f .github/workflows/templates/docker-compose.yml run --rm playwright /e2e.sh all
env:
INTEGRATION_TESTS_BRANCH: ${{inputs.testBranch}}
MAGENTO_ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
name: Magento 2 Release E2E Pipeline
run-name: E2E tests against Test Repository with Express Checkout
name: Magento 2 Express Checkout E2E Pipeline
run-name: Adyen Magento 2 Express Checkout Plugin E2E tests

on:
workflow_dispatch:
#pull_request:
#types: [opened, synchronize, reopened, ready_for_review]
# This workflow will be ignored for all PRs temporarily
# Until express checkout flow is fixed
# branches: [main, develop]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [main]

jobs:
build:
if: |
${{
github.event.pull_request.draft == false &&
(github.actor != 'renovate[bot]' || github.actor != 'lgtm-com[bot]')
}}
runs-on:
group: larger-runners
labels: ubuntu-latest-8-cores
Expand Down Expand Up @@ -43,29 +46,6 @@ jobs:
- name: Install plugin
run: docker exec -u www-data magento2-container make plugin

- name: Checkout developer module
uses: actions/checkout@v3
with:
repository: Adyen/adyen-magento2-dev
ref: 'main'
token: ${{ secrets.ADYEN_AUTOMATION_BOT_TEST_ACCESS_TOKEN }}
path: Developer

- name: Make the folder for dev module
run: docker exec -u www-data magento2-container mkdir -p /var/www/html/app/code/Adyen

- name: Copy dev module into Docker container
run: docker cp ./Developer magento2-container:/var/www/html/app/code/Adyen

- name: Change ownership of developer module folder
run: docker exec magento2-container chown -R www-data:www-data /var/www/html/app/code/Adyen/Developer

- name: Enable developer module
run: docker exec -u www-data magento2-container make dev-module

- name: Kill Cron Jobs
run: docker exec magento2-container /etc/init.d/cron stop

- name: Install Express module
run: docker exec -u www-data magento2-container composer require adyen/adyen-magento2-expresscheckout:dev-rc-v2

Expand All @@ -79,9 +59,9 @@ jobs:
run: docker exec magento2-container make fs

- name: Run E2E tests
run: docker-compose -f .github/workflows/templates/docker-compose.yml run --rm playwright /e2e-all.sh
run: docker-compose -f .github/workflows/templates/docker-compose.yml run --rm playwright /e2e-all.sh express
env:
INTEGRATION_TESTS_BRANCH: develop-9
INTEGRATION_TESTS_BRANCH: develop
MAGENTO_ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}}
MAGENTO_ADMIN_PASSWORD: ${{secrets.MAGENTO_ADMIN_PASSWORD}}
MAGENTO_BASE_URL: ${{secrets.MAGENTO_BASE_URL}}
Expand Down
47 changes: 23 additions & 24 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
name: Magento 2 E2E Pipeline
run-name: E2E tests for Adyen Magento2 Plugin
run-name: Adyen Magento 2 Payment Plugin E2E tests

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
# This workflow will be used for all PRs temporarily
# Until express checkout flow is fixed
# branches-ignore: [main]

jobs:
build:
if: |
${{
github.event.pull_request.draft == false &&
(github.actor != 'renovate' || github.actor != 'lgtm-com')
(github.actor != 'renovate[bot]' || github.actor != 'lgtm-com[bot]')
}}
runs-on:
group: larger-runners
Expand Down Expand Up @@ -47,28 +44,30 @@ jobs:
- name: Install plugin
run: docker exec -u www-data magento2-container make plugin

- name: Checkout developer module
uses: actions/checkout@v3
with:
repository: Adyen/adyen-magento2-dev
ref: 'main'
token: ${{ secrets.ADYEN_AUTOMATION_BOT_TEST_ACCESS_TOKEN }}
path: Developer
# The commented out section will be re-enabled with ECP-8686

# - name: Checkout developer module
# uses: actions/checkout@v3
# with:
# repository: Adyen/adyen-magento2-dev
# ref: 'main'
# token: ${{ secrets.ADYEN_AUTOMATION_BOT_TEST_ACCESS_TOKEN }}
# path: Developer

- name: Make the folder for dev module
run: docker exec -u www-data magento2-container mkdir -p /var/www/html/app/code/Adyen
# - name: Make the folder for dev module
# run: docker exec -u www-data magento2-container mkdir -p /var/www/html/app/code/Adyen

- name: Copy dev module into Docker container
run: docker cp ./Developer magento2-container:/var/www/html/app/code/Adyen
# - name: Copy dev module into Docker container
# run: docker cp ./Developer magento2-container:/var/www/html/app/code/Adyen

- name: Change ownership of developer module folder
run: docker exec magento2-container chown -R www-data:www-data /var/www/html/app/code/Adyen/Developer
# - name: Change ownership of developer module folder
# run: docker exec magento2-container chown -R www-data:www-data /var/www/html/app/code/Adyen/Developer

- name: Enable developer module
run: docker exec -u www-data magento2-container make dev-module
# - name: Enable developer module
# run: docker exec -u www-data magento2-container make dev-module

- name: Kill Cron Jobs
run: docker exec magento2-container /etc/init.d/cron stop
# - name: Kill Cron Jobs
# run: docker exec magento2-container /etc/init.d/cron stop

- name: Switch to production mode
run: docker exec -u www-data magento2-container make production
Expand All @@ -77,9 +76,9 @@ jobs:
run: docker exec magento2-container make fs

- name: Run E2E tests
run: docker-compose -f .github/workflows/templates/docker-compose.yml run --rm playwright /e2e.sh
run: docker-compose -f .github/workflows/templates/docker-compose.yml run --rm playwright /e2e.sh standard
env:
INTEGRATION_TESTS_BRANCH: develop-9
INTEGRATION_TESTS_BRANCH: develop
MAGENTO_ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}}
MAGENTO_ADMIN_PASSWORD: ${{secrets.MAGENTO_ADMIN_PASSWORD}}
MAGENTO_BASE_URL: ${{secrets.MAGENTO_BASE_URL}}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/templates/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ services:
- WEBHOOK_PASSWORD
volumes:
- ../../scripts/e2e.sh:/e2e.sh
- ../../scripts/e2e-all.sh:/e2e-all.sh
- ../../../test-report:/tmp/test-report
networks:
backend:
Expand Down

0 comments on commit 2454b7f

Please sign in to comment.