Skip to content

Commit

Permalink
Merge pull request #2535 from Adyen/develop
Browse files Browse the repository at this point in the history
Release 9.3.0
  • Loading branch information
peterojo authored Mar 8, 2024
2 parents 3824691 + fdfa229 commit f0e8f18
Show file tree
Hide file tree
Showing 37 changed files with 1,456 additions and 370 deletions.
4 changes: 2 additions & 2 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RUN a2enmod ssl
RUN a2ensite default-ssl.conf #can be removed if not needed
WORKDIR /var/www/html
COPY config/php.ini /usr/local/etc/php/
COPY config/install_magento.sh /tmp/install_magento.sh
COPY scripts/install_magento.sh /tmp/install_magento.sh

RUN if [ -x "$(command -v apache2-foreground)" ]; then a2enmod rewrite; fi

Expand All @@ -55,4 +55,4 @@ ADD "https://github.com/magento/magento2-sample-data/archive/refs/tags/${MAGENTO

RUN chmod +x /tmp/install_magento.sh

CMD ["bash", "/tmp/install_magento.sh"]
CMD ["bash", "/tmp/install_magento.sh"]
44 changes: 2 additions & 42 deletions .github/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ configure: n98-magerun2.phar
bin/magento config:set payment/adyen_abstract/demo_mode 1
bin/magento adyen:enablepaymentmethods:run
bin/magento config:set payment/adyen_abstract/has_holder_name 1
bin/magento config:set payment/adyen_pay_by_link/active 1
bin/magento config:set payment/adyen_pay_by_link/days_to_expire 5
bin/magento config:set payment/adyen_giving/active 1
bin/magento config:set payment/adyen_giving/charity_description 'test'
Expand Down Expand Up @@ -70,30 +71,15 @@ plugin: install configure flush
fs:
find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
chmod 777 -R var
chown -R www-data:www-data .
chmod u+x bin/magento
echo "memory_limit = -1" > /usr/local/etc/php/conf.d/memory.ini

# Deploy sample data
sampledata:
composer config http-basic.repo.magento.com "${MAGENTO_USERNAME}" "${MAGENTO_PASSWORD}"
composer config repositories.magento composer https://repo.magento.com/
bin/magento sampledata:deploy
bin/magento setup:upgrade

# Production mode
production:
bin/magento deploy:mode:set production

# JavaScript bundling
bundlejs:
bin/magento config:set dev/js/enable_js_bundling 1
bin/magento config:set dev/js/minify_files 1
bin/magento config:set dev/static/sign 1
bin/magento config:set dev/js/merge_files 0
bin/magento setup:static-content:deploy
bin/magento cache:clean config

MAGENTO_ROOT=/var/www/html
GRAPHQL_XML=${MAGENTO_ROOT}/dev/tests/api-functional/phpunit_graphql.xml.dist
GRAPHQL_PHP=/data/extensions/workdir/Test/phpunit_graphql.php
Expand All @@ -111,16 +97,6 @@ restapi:
--configuration ${MAGENTO_ROOT}/dev/tests/api-functional/phpunit_rest.xml.dist \
${MAGENTO_ROOT}/vendor/adyen/module-payment/Test/api-functional/Webapi

# Destroy services
clean:
docker-compose -f workflows/templates/docker-compose.yml down --volumes --rmi local
docker-compose -f docker-compose.yml -f docker-compose.mftf.yml down --volumes --rmi local

# Docker image build
image:
docker-compose -f workflows/templates/docker-compose.yml -f docker-compose.e2e.yml build
docker-compose -f docker-compose.yml -f docker-compose.mftf.yml build

# Setup environment to run functional tests (https://devdocs.magento.com/mftf/docs/getting-started.html)
setup-mftf:
bin/magento config:set currency/options/allow USD,EUR
Expand Down Expand Up @@ -153,19 +129,3 @@ setup-mftf:
# Magento Functional Testing Framework
mftf:
vendor/bin/mftf run:group --remove -- AdyenMagentoSuite || vendor/bin/mftf run:failed

# Simulate a full CI build
ci:
docker-compose -f workflows/templates/docker-compose.yml run --rm web make magento
docker-compose -f workflows/templates/docker-compose.yml up -d web

docker exec magento2-container make fs
docker exec magento2-container make sys-check
docker exec -u www-data magento2-container make plugin
docker exec magento2-container /etc/init.d/cron stop
docker exec -u www-data magento2-container make unit
docker exec magento2-container make graphql
docker exec -u www-data magento2-container make production
docker exec magento2-container make fs

docker-compose -f workflows/templates/docker-compose.yml run --rm playwright /e2e.sh
9 changes: 5 additions & 4 deletions .github/docker-compose.e2e.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
playwright:
image: mcr.microsoft.com/playwright:v1.41.2-focal
image: mcr.microsoft.com/playwright:v1.40.1
shm_size: 1gb
ipc: host
cap_add:
Expand All @@ -22,7 +22,8 @@ services:
- GOOGLE_PASSWORD
- WEBHOOK_USERNAME
- WEBHOOK_PASSWORD

volumes:
- ../../scripts/e2e.sh:/e2e.sh
- ../../../test-report:/tmp/test-report
- ./scripts/e2e.sh:/e2e.sh
- ../test-report:/tmp/test-report
networks:
backend:
36 changes: 21 additions & 15 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,37 @@ services:
- PHP_VERSION=${PHP_VERSION}
- MAGENTO_VERSION=${MAGENTO_VERSION}
container_name: magento2-container
extra_hosts:
- "magento2.test.com:127.0.0.1"
networks:
backend:
aliases:
- magento2.test.com
environment:
- DB_SERVER=mariadb
- ELASTICSEARCH_SERVER=elasticsearch
- MAGENTO_HOST=magento2.test.com
- VIRTUAL_HOST=magento2.test.com
- ADMIN_URLEXT=admin
- DONATION_ACCOUNT
- ADMIN_USERNAME
- ADMIN_PASSWORD
- ADYEN_MERCHANT
- ADYEN_API_KEY
- ADYEN_CLIENT_KEY
- PHP_VERSION
- MAGENTO_VERSION
- WEBHOOK_USERNAME
- WEBHOOK_PASSWORD
DB_SERVER: mariadb
ELASTICSEARCH_SERVER: elasticsearch
MAGENTO_HOST: magento2.test.com
VIRTUAL_HOST: magento2.test.com
COMPOSER_MEMORY_LIMIT: -1
DEPLOY_SAMPLEDATA:
DONATION_ACCOUNT:
ADMIN_USERNAME:
ADMIN_PASSWORD:
ADYEN_MERCHANT:
ADYEN_API_KEY:
ADYEN_CLIENT_KEY:
PHP_VERSION:
MAGENTO_VERSION:
depends_on:
- db
- elastic
volumes:
- ../:/data/extensions/workdir
- ./Makefile:/var/www/html/Makefile
- composer:/usr/local/bin
- magento:/var/www/html
networks:
backend:
volumes:
magento:
composer:
1 change: 1 addition & 0 deletions .github/scripts/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cd adyen-integration-tools-tests
git checkout $INTEGRATION_TESTS_BRANCH
rm -rf package-lock.json
npm i
npx playwright install

option="$1"

Expand Down
File renamed without changes.
21 changes: 9 additions & 12 deletions .github/workflows/e2e-test-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ jobs:
env:
PHP_VERSION: "8.1"
MAGENTO_VERSION: "2.4.5"
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}}
ADMIN_PASSWORD: ${{secrets.MAGENTO_ADMIN_PASSWORD}}
DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}}
DEPLOY_SAMPLEDATA: 1
steps:
- uses: actions/checkout@v3

- name: Install Magento
run: docker-compose -f .github/workflows/templates/docker-compose.yml run --rm web make 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/workflows/templates/docker-compose.yml up -d web
env:
DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}

run: docker-compose -f .github/docker-compose.yml up -d web

- name: Setup permissions
run: docker exec magento2-container make fs

Expand Down Expand Up @@ -94,17 +94,14 @@ 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 ${{inputs.testGroup}}
run: docker-compose -f .github/docker-compose.e2e.yml run --rm playwright /e2e.sh ${{inputs.testGroup}}
env:
INTEGRATION_TESTS_BRANCH: ${{inputs.testBranch}}
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}}
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
GOOGLE_USERNAME: ${{secrets.GOOGLE_USERNAME}}
GOOGLE_PASSWORD: ${{secrets.GOOGLE_PASSWORD}}
WEBHOOK_USERNAME: admin
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/e2e-test-express-checkout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ jobs:
env:
PHP_VERSION: "8.1"
MAGENTO_VERSION: "2.4.5"
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}}
ADMIN_PASSWORD: ${{secrets.MAGENTO_ADMIN_PASSWORD}}
DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}}
DEPLOY_SAMPLEDATA: 1
steps:
- uses: actions/checkout@v3

- name: Install Magento
run: docker-compose -f .github/workflows/templates/docker-compose.yml run --rm web make 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/workflows/templates/docker-compose.yml up -d web
env:
DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
run: docker-compose -f .github/docker-compose.yml up -d web

- name: Setup permissions
run: docker exec magento2-container make fs
Expand All @@ -59,17 +59,14 @@ 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 express-checkout
run: docker-compose -f .github/docker-compose.e2e.yml run --rm playwright /e2e.sh express-checkout
env:
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}}
PAYPAL_USERNAME: ${{secrets.PLAYWRIGHT_PAYPAL_USERNAME}}
PAYPAL_PASSWORD: ${{secrets.PLAYWRIGHT_PAYPAL_PASSWORD}}
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
GOOGLE_USERNAME: ${{secrets.GOOGLE_USERNAME}}
GOOGLE_PASSWORD: ${{secrets.GOOGLE_PASSWORD}}
WEBHOOK_USERNAME: admin
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ jobs:
env:
PHP_VERSION: "8.1"
MAGENTO_VERSION: "2.4.5"
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}}
ADMIN_PASSWORD: ${{secrets.MAGENTO_ADMIN_PASSWORD}}
DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}}
DEPLOY_SAMPLEDATA: 1
steps:
- uses: actions/checkout@v3

- name: Install Magento
run: docker-compose -f .github/workflows/templates/docker-compose.yml run --rm web make 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/workflows/templates/docker-compose.yml up -d web
env:
DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
run: docker-compose -f .github/docker-compose.yml up -d web

- name: Setup permissions
run: docker exec magento2-container make fs
Expand Down Expand Up @@ -72,17 +72,14 @@ 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 standard
run: docker-compose -f .github/docker-compose.e2e.yml run --rm playwright /e2e.sh standard
env:
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}}
PAYPAL_USERNAME: ${{secrets.PLAYWRIGHT_PAYPAL_USERNAME}}
PAYPAL_PASSWORD: ${{secrets.PLAYWRIGHT_PAYPAL_PASSWORD}}
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
WEBHOOK_USERNAME: admin
WEBHOOK_PASSWORD: 1234

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/graphql-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ jobs:
MAGENTO_VERSION: ${{ matrix.magento-version }}
ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}}
ADMIN_PASSWORD: ${{secrets.MAGENTO_ADMIN_PASSWORD}}
DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
DEPLOY_SAMPLEDATA: 1

steps:
- uses: actions/checkout@v3

- name: Install Magento
run: docker-compose -f .github/workflows/templates/docker-compose.yml run --rm web make 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/workflows/templates/docker-compose.yml up -d web
env:
DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
run: docker-compose -f .github/docker-compose.yml up -d web

- name: Setup permissions
run: docker exec magento2-container make fs
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/mftf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Functional Tests
on:
workflow_dispatch:
pull_request:
branches: [main]
branches: [main, develop]

jobs:
build:
Expand All @@ -17,16 +17,16 @@ jobs:
MAGENTO_VERSION: ${{ matrix.magento-version }}
ADMIN_USERNAME: ${{ secrets.MAGENTO_ADMIN_USERNAME }}
ADMIN_PASSWORD: ${{ secrets.MAGENTO_ADMIN_PASSWORD }}
DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
ADMIN_URLEXT: admin
steps:
- uses: actions/checkout@v3

- name: Start services
run: docker-compose -f .github/docker-compose.yml -f .github/docker-compose.mftf.yml up -d
env:
DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}

# Temp solution to wait for install script to run
- name: Sleep for 120 seconds
Expand Down
Loading

0 comments on commit f0e8f18

Please sign in to comment.