Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ fs:
production:
bin/magento deploy:mode:set production

# E2E test setup
setup-e2e:
bin/magento config:set currency/options/allow USD,EUR,NOK
mysql -h "$$DB_SERVER" -P "$$DB_PORT" -u "$$DB_USER" -p"$$DB_PASSWORD" "$$DB_NAME" -e \
"INSERT INTO $${DB_PREFIX}directory_currency_rate (currency_from, currency_to, rate) VALUES ('EUR', 'NOK', 11) ON DUPLICATE KEY UPDATE rate = VALUES(rate);"
Comment on lines +87 to +88
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The INSERT ... ON DUPLICATE KEY UPDATE statement is generally good for idempotency. However, directly embedding SQL with string concatenation for DB_PREFIX can be a security risk if DB_PREFIX is user-controlled or not properly sanitized. While DB_PREFIX is likely an internal variable in a Makefile, it's a good practice to be cautious with direct SQL injection possibilities. Consider using a more robust method for database interaction if DB_PREFIX could ever be influenced by external input, or ensure it's strictly controlled.

bin/magento cache:flush
# End of E2E test setup

# GraphQL tests
GRAPHQL_XML_DIST=${MAGENTO_ROOT}/vendor/adyen/module-payment/Test/phpunit_graphql.xml.dist
GRAPHQL_XML=${MAGENTO_ROOT}/dev/tests/api-functional/phpunit_graphql.xml
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ jobs:
if: ${{ env.EXPRESS_BRANCH }}
run: docker exec -u www-data magento2-container make enable-express

- name: Setup E2E test configurations
run: docker exec magento2-container make setup-e2e

- name: Switch to production mode
run: docker exec -u www-data magento2-container make production

Expand Down
Loading