Skip to content

Commit

Permalink
[ECP-8686] Fix webhook E2E test (#2386)
Browse files Browse the repository at this point in the history
* [ECP-8686] Add missing webhook credentials

* Update .github/Makefile

* Update .github/Makefile

* Enable webhook tests and upload logs

* update Makefile

* Update make file

* Update .github/workflows/templates/docker-compose.yml

* Apply suggestions from code review

* Update .github/workflows/e2e-test-dispatch.yml

* Apply suggestions from code review

* Use double quote for secrets

* Pass env variables in startup phase

* use ADYEN_WEBHOOK_USERNAME and ADYEN_WEBHOOK_PASSWORD secrets

* revert new secrets

* revert new secrets

* add option to run webhook

* add test group input

* add test:ci:magento:backoffice cmd

* Update .github/scripts/e2e.sh

* Apply suggestions from code review

* Apply suggestions from code review

---------

Co-authored-by: Can Demiralp <[email protected]>
Co-authored-by: Cenk Kucukiravul <[email protected]>
Co-authored-by: Cenk Kucukiravul <[email protected]>
  • Loading branch information
4 people authored Dec 14, 2023
1 parent 765ef4b commit fbe0db4
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 12 deletions.
7 changes: 4 additions & 3 deletions .github/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ configure: n98-magerun2.phar
bin/magento config:set payment/adyen_abstract/notifications_ip_check 0
bin/magento config:set payment/adyen_abstract/payment_authorized 'processing'
bin/magento config:set payment/adyen_abstract/payment_pre_authorized 'pending_payment'
bin/magento config:set payment/adyen_abstract/capture_mode 'auto'
bin/magento config:set payment/adyen_abstract/capture_mode 'manual'
bin/magento config:set payment/adyen_abstract/paypal_capture_mode 0
bin/magento config:set payment/adyen_abstract/recurring_configuration '{"adyen_cc":{"name":"Credit Card","enabled":"1","recurringProcessingModel":"CardOnFile"}}'
bin/magento config:set payment/adyen_cc_vault/require_cvc 1

./n98-magerun2.phar config:store:set --encrypt payment/adyen_abstract/api_key_test "${ADYEN_API_KEY}" > /dev/null
bin/magento config:set payment/adyen_abstract/client_key_test "${ADYEN_CLIENT_KEY}"
bin/magento config:set payment/adyen_abstract/notification_username 'admin'
./n98-magerun2.phar config:store:set --encrypt payment/adyen_abstract/notification_password '1234' > /dev/null
./n98-magerun2.phar config:store:set --encrypt payment/adyen_abstract/api_key_test "${ADYEN_API_KEY}" > /dev/null

# Clear cache
flush:
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/e2e-test-dispatch.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Integration Test Repository Dispatch Pipeline
run-name: E2E tests against Test Repository ${{inputs.testBranch}} with Express Checkout ${{inputs.expressBranch}}
run-name: E2E tests against Test Repository ${{inputs.testBranch}} with Express Checkout ${{inputs.expressBranch}} with test group ${{inputs.testGroup}}

on:
workflow_dispatch:
Expand All @@ -12,6 +12,15 @@ on:
description: "Express Checkout Repository Pipeline"
required: true
default: "develop"
testGroup:
description: "Test group"
required: true
default: "all"
type: choice
options:
- all
- standard
- express-checkout

jobs:
build:
Expand Down Expand Up @@ -85,7 +94,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.sh all
run: docker-compose -f .github/workflows/templates/docker-compose.yml run --rm playwright /e2e.sh ${{inputs.testGroup}}
env:
INTEGRATION_TESTS_BRANCH: ${{inputs.testBranch}}
MAGENTO_ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}}
Expand All @@ -98,12 +107,19 @@ jobs:
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
GOOGLE_USERNAME: ${{secrets.GOOGLE_USERNAME}}
GOOGLE_PASSWORD: ${{secrets.GOOGLE_PASSWORD}}
WEBHOOK_USERNAME: ${{secrets.WEBHOOK_USERNAME}}
WEBHOOK_PASSWORD: ${{secrets.WEBHOOK_PASSWORD}}
WEBHOOK_USERNAME: admin
WEBHOOK_PASSWORD: 1234

- name: Archive test result artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: html-report
path: test-report

- name: Archive application log artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: logs
path: magento-logs
5 changes: 2 additions & 3 deletions .github/workflows/e2e-test-express-checkout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ jobs:
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
GOOGLE_USERNAME: ${{secrets.GOOGLE_USERNAME}}
GOOGLE_PASSWORD: ${{secrets.GOOGLE_PASSWORD}}
WEBHOOK_USERNAME: ${{secrets.WEBHOOK_USERNAME}}
WEBHOOK_PASSWORD: ${{secrets.WEBHOOK_PASSWORD}}

WEBHOOK_USERNAME: admin
WEBHOOK_PASSWORD: 1234
- name: Archive test result artifacts
if: always()
uses: actions/upload-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ jobs:
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
WEBHOOK_USERNAME: ${{secrets.WEBHOOK_USERNAME}}
WEBHOOK_PASSWORD: ${{secrets.WEBHOOK_PASSWORD}}
WEBHOOK_USERNAME: admin
WEBHOOK_PASSWORD: 1234

- name: Archive test result artifacts
if: always()
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/templates/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ services:
ADYEN_CLIENT_KEY:
PHP_VERSION:
MAGENTO_VERSION:
WEBHOOK_PASSWORD:
WEBHOOK_USERNAME:
depends_on:
- db
- elastic
Expand All @@ -54,6 +56,7 @@ services:
- composer:/usr/local/bin
- magento:/var/www/html
- ../../Makefile:/var/www/html/Makefile
# - ../../../magento-logs:/var/www/html/var/log
networks:
backend:
aliases:
Expand Down

0 comments on commit fbe0db4

Please sign in to comment.