-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trigger E2E test on the repository workflows and start using Open Sea…
…rch (#139) * Install Magento and trigger E2E test on the repository * Use free Ubuntu runners * Migrate to Open Search * Downgrade to PHP 8.2 * Switch to paid runners and set timeout * Rename the workflow * Update environment variables * Remove irrelevant env variable --------- Co-authored-by: Can Demiralp <[email protected]>
- Loading branch information
1 parent
6093b6c
commit 76566d5
Showing
8 changed files
with
150 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,10 @@ DB_NAME=magento \ | |
DB_USER=magento \ | ||
DB_PASSWORD=magento \ | ||
DB_PREFIX=m2_ \ | ||
ELASTICSEARCH_SERVER="<will be defined>" \ | ||
ELASTICSEARCH_PORT=9200 \ | ||
ELASTICSEARCH_INDEX_PREFIX=magento2 \ | ||
ELASTICSEARCH_TIMEOUT=15 \ | ||
OPENSEARCH_SERVER="<will be defined>" \ | ||
OPENSEARCH_PORT=9200 \ | ||
OPENSEARCH_INDEX_PREFIX=magento2 \ | ||
OPENSEARCH_TIMEOUT=15 \ | ||
ADMIN_NAME=admin \ | ||
ADMIN_LASTNAME=admin \ | ||
[email protected] \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: '3' | ||
services: | ||
playwright: | ||
image: mcr.microsoft.com/playwright:v1.47.2 | ||
shm_size: 1gb | ||
ipc: host | ||
cap_add: | ||
- SYS_ADMIN | ||
networks: | ||
- backend | ||
environment: | ||
- INTEGRATION_TESTS_BRANCH | ||
- MAGENTO_BASE_URL | ||
- MAGENTO_ADMIN_USERNAME | ||
- MAGENTO_ADMIN_PASSWORD | ||
- PAYPAL_USERNAME | ||
- PAYPAL_PASSWORD | ||
- ADYEN_API_KEY | ||
- ADYEN_CLIENT_KEY | ||
- ADYEN_MERCHANT | ||
- GOOGLE_USERNAME | ||
- GOOGLE_PASSWORD | ||
- WEBHOOK_USERNAME | ||
- WEBHOOK_PASSWORD | ||
- CI | ||
volumes: | ||
- ./scripts/e2e.sh:/e2e.sh | ||
- ../test-report:/tmp/test-report | ||
networks: | ||
backend: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# 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 | ||
npx playwright install | ||
|
||
option="$1" | ||
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,72 @@ | ||
name: Adyen Magento 2 Express Checkout Plugin E2E Trigger Workflow | ||
run-name: Headless E2E tests for ${{ github.event.pull_request.head.ref}} | ||
name: E2E test workflow | ||
run-name: Headless E2E tests for ${{ github.event.pull_request.head.ref }} | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
branches: [main, develop] | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor != 'renovate[bot]' || github.actor != 'lgtm-com[bot]' }} | ||
build: | ||
strategy: | ||
matrix: | ||
php-version: ["8.2"] | ||
magento-version: ["2.4.6-p8"] | ||
runs-on: | ||
group: larger-runners | ||
labels: ubuntu-latest-8-cores | ||
timeout-minutes: 10 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ADYEN_AUTOMATION_BOT_TEST_ACCESS_TOKEN }} | ||
PHP_VERSION: ${{ matrix.php-version }} | ||
MAGENTO_VERSION: ${{ matrix.magento-version }} | ||
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}} | ||
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}} | ||
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}} | ||
DEPLOY_SAMPLEDATA: 1 | ||
steps: | ||
- name: Run E2E Tests | ||
run: gh workflow run e2e-test-dispatch.yml -R Adyen/adyen-magento2 -F expressBranch=${{ github.event.pull_request.head.ref }} -F testGroup="express-checkout" | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Magento | ||
run: docker compose -f .github/docker-compose.yml run --rm web make magento | ||
|
||
- name: Start web server in background | ||
run: docker compose -f .github/docker-compose.yml up -d web | ||
|
||
- name: Setup permissions | ||
run: docker exec magento2-container make fs | ||
|
||
- name: Check install | ||
run: docker exec magento2-container make sys-check | ||
|
||
- name: Install plugin | ||
run: docker exec -u www-data magento2-container make plugin | ||
|
||
- 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 | ||
|
||
- name: Setup permissions | ||
run: docker exec magento2-container make fs | ||
|
||
- name: Run E2E tests | ||
run: docker compose -f .github/docker-compose.e2e.yml run --rm playwright /e2e.sh express-checkout | ||
env: | ||
INTEGRATION_TESTS_BRANCH: ${{ env.TEST_BRANCH }} | ||
MAGENTO_ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}} | ||
MAGENTO_ADMIN_PASSWORD: ${{secrets.MAGENTO_ADMIN_PASSWORD}} | ||
MAGENTO_BASE_URL: ${{secrets.MAGENTO_BASE_URL}} | ||
PAYPAL_USERNAME: ${{secrets.PLAYWRIGHT_PAYPAL_USERNAME}} | ||
PAYPAL_PASSWORD: ${{secrets.PLAYWRIGHT_PAYPAL_PASSWORD}} | ||
GOOGLE_USERNAME: ${{secrets.PLAYWRIGHT_GOOGLE_USERNAME}} | ||
GOOGLE_PASSWORD: ${{secrets.PLAYWRIGHT_GOOGLE_PASSWORD}} | ||
WEBHOOK_USERNAME: admin | ||
WEBHOOK_PASSWORD: 1234 | ||
CI: TRUE | ||
|
||
- name: Archive test result artifacts | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: html-report | ||
path: test-report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters