Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECP-9608] Cover Magento 2.4.4-p12 on automated tests #2899

Open
wants to merge 22 commits into
base: feature/build-pipeline-for-m244
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ OPENSEARCH_SERVER="<will be defined>" \
OPENSEARCH_PORT=9200 \
OPENSEARCH_INDEX_PREFIX=magento2 \
OPENSEARCH_TIMEOUT=15 \
OPENSEARCH_VERSION="<will be defined>" \
ADMIN_NAME=admin \
ADMIN_LASTNAME=admin \
[email protected] \
Expand Down
16 changes: 8 additions & 8 deletions .github/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Install N98-Magerun
n98-magerun2.phar:
wget -q https://files.magerun.net/n98-magerun2.phar
chmod +x ./n98-magerun2.phar
build-n98-magerun2:
wget -q https://files.magerun.net/n98-magerun2-${N98_MAGERUN_VERSION}.phar
chmod +x ./n98-magerun2-${N98_MAGERUN_VERSION}.phar

# Check Magento installation
sys-check: n98-magerun2.phar
./n98-magerun2.phar sys:check
sys-check: build-n98-magerun2
./n98-magerun2-${N98_MAGERUN_VERSION}.phar sys:check

# Install Magento (without starting Apache)
magento:
Expand All @@ -26,7 +26,7 @@ dev-module:
bin/magento setup:upgrade

# Configuration
configure: n98-magerun2.phar
configure:
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
Expand All @@ -49,8 +49,8 @@ configure: n98-magerun2.phar
bin/magento config:set payment/adyen_abstract/client_key_test "${ADYEN_CLIENT_KEY}"
bin/magento config:set payment/adyen_abstract/notification_username 'admin'
bin/magento config:set payment/adyen_abstract/payment_methods_active 1
./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
./n98-magerun2-${N98_MAGERUN_VERSION}.phar config:store:set --encrypt payment/adyen_abstract/notification_password '1234' > /dev/null
./n98-magerun2-${N98_MAGERUN_VERSION}.phar config:store:set --encrypt payment/adyen_abstract/api_key_test "${ADYEN_API_KEY}" > /dev/null

# Clear cache
flush:
Expand Down
6 changes: 3 additions & 3 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
db:
image: mariadb:10.4
Expand All @@ -12,7 +10,7 @@ services:
MARIADB_USER: magento
MARIADB_PASSWORD: magento
opensearch:
image: bitnami/opensearch:2
image: bitnami/opensearch:${OPENSEARCH_VERSION}
container_name: opensearch-container
networks:
- backend
Expand All @@ -38,6 +36,8 @@ services:
environment:
DB_SERVER: mariadb
OPENSEARCH_SERVER: opensearch-container
OPENSEARCH_VERSION:
N98_MAGERUN_VERSION:
MAGENTO_HOST: magento2.test.com
VIRTUAL_HOST: magento2.test.com
COMPOSER_MEMORY_LIMIT: -1
Expand Down
20 changes: 14 additions & 6 deletions .github/scripts/install_magento.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,20 @@ else
fi

if [ "$OPENSEARCH_SERVER" != "<will be defined>" ]; then
MAGENTO_INSTALL_ARGS=$(echo \
--search-engine="opensearch" \
--opensearch-host="$OPENSEARCH_SERVER" \
--opensearch-port="$OPENSEARCH_PORT" \
--opensearch-index-prefix="$OPENSEARCH_INDEX_PREFIX" \
--opensearch-timeout="$OPENSEARCH_TIMEOUT")
if [ "$OPENSEARCH_VERSION" -eq 2 ]; then
MAGENTO_INSTALL_ARGS=$(echo \
--search-engine="opensearch" \
--opensearch-host="$OPENSEARCH_SERVER" \
--opensearch-port="$OPENSEARCH_PORT" \
--opensearch-index-prefix="$OPENSEARCH_INDEX_PREFIX" \
--opensearch-timeout="$OPENSEARCH_TIMEOUT")
else
MAGENTO_INSTALL_ARGS=$(echo \
--elasticsearch-host="$OPENSEARCH_SERVER" \
--elasticsearch-port="$OPENSEARCH_PORT" \
--elasticsearch-index-prefix="$OPENSEARCH_INDEX_PREFIX" \
--elasticsearch-timeout="$OPENSEARCH_TIMEOUT")
fi
RET=1
while [ $RET -ne 0 ]; do
echo "Checking if $OPENSEARCH_SERVER is available."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:

jobs:
analyze:
codeql_analyze_job:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 25
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ on:
default: "main"

jobs:
build:
run_e2e_test_job:
name: Run E2E tests
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) || (github.event_name == 'workflow_dispatch')
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'external' || 'internal' }}
strategy:
matrix:
php-version: ["8.3"]
magento-version: ["2.4.7-p2"]
php-version: ["8.1"]
magento-version: ["2.4.4-p12","2.4.7-p4"]
runs-on:
group: larger-runners
labels: ubuntu-latest-8-cores
Expand All @@ -54,6 +55,8 @@ jobs:
- run: echo "TEST_GROUP=${{ env.IS_RELEASE == 'TRUE' && 'all' || (inputs.testGroup || 'standard') }}" >> $GITHUB_ENV
- run: echo "TEST_BRANCH=${{ (env.IS_RELEASE == 'TRUE' || !inputs.testBranch) && 'develop' || inputs.testBranch }}" >> $GITHUB_ENV
- run: echo "EXPRESS_BRANCH=${{ contains(fromJSON('["all", "express-checkout"]'), env.TEST_GROUP) && (inputs.expressBranch || 'main') || '' }}" >> $GITHUB_ENV
- run: echo "OPENSEARCH_VERSION=${{ contains(matrix.magento-version, '2.4.4') && '1' || '2' }}" >> $GITHUB_ENV
- run: echo "N98_MAGERUN_VERSION=${{ contains(matrix.magento-version, '2.4.4') && '7.5.0' || 'latest' }}" >> $GITHUB_ENV

- name: Information
run: echo "E2E testing against test suite branch ${{env.TEST_BRANCH}} using group ${{env.TEST_GROUP}} ${{ env.EXPRESS_BRANCH && 'with express module branch' || '' }} ${{ env.EXPRESS_BRANCH || '' }}"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/graphql-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: GraphQL Tests
on: [pull_request, pull_request_target]

jobs:
build:
run_graphql_test_job:
name: Run GraphQL API functional tests
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository)
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'external' || 'internal' }}
strategy:
Expand All @@ -14,6 +15,8 @@ jobs:
env:
PHP_VERSION: ${{ matrix.php-version }}
MAGENTO_VERSION: ${{ matrix.magento-version }}
OPENSEARCH_VERSION: 2
N98_MAGERUN_VERSION: latest
ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}}
ADMIN_PASSWORD: ${{secrets.MAGENTO_ADMIN_PASSWORD}}
DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
workflow_dispatch:

jobs:
build:
run_main_test_job:
name: Run unit tests and code sniffer
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) || (github.event_name == 'workflow_dispatch')
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'external' || 'internal' }}
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/mftf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
branches: [main]

jobs:
build:
mftf_job:
name: Run Magento Functional Test Framework
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository)
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'external' || 'internal' }}
strategy:
Expand All @@ -20,6 +21,7 @@ jobs:
env:
PHP_VERSION: ${{ matrix.php-version }}
MAGENTO_VERSION: ${{ matrix.magento-version }}
OPENSEARCH_VERSION: 2
ADMIN_USERNAME: ${{ secrets.MAGENTO_ADMIN_USERNAME }}
ADMIN_PASSWORD: ${{ secrets.MAGENTO_ADMIN_PASSWORD }}
DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/restapi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: REST API Tests
on: [pull_request, pull_request_target]

jobs:
build:
rest_test_job:
name: Run REST API functional tests
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository)
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'external' || 'internal' }}
strategy:
Expand All @@ -14,6 +15,8 @@ jobs:
env:
PHP_VERSION: ${{ matrix.php-version }}
MAGENTO_VERSION: ${{ matrix.magento-version }}
OPENSEARCH_VERSION: 2
N98_MAGERUN_VERSION: latest
ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}}
ADMIN_PASSWORD: ${{secrets.MAGENTO_ADMIN_PASSWORD}}
DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}}
Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/System/Config/Field/Tokenization.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function _prepareToRender(): void
);
}

private function getEnabledRenderer(): SelectYesNo|BlockInterface
private function getEnabledRenderer(): BlockInterface
{
if (!$this->enabledRenderer) {
$this->enabledRenderer = $this->getLayout()->createBlock(
Expand Down
2 changes: 1 addition & 1 deletion Model/Sales/OrderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function __construct(
$this->filterGroupBuilder = $filterGroupBuilder;
}

public function getOrderByQuoteId(int $quoteId): OrderInterface|false
public function getOrderByQuoteId(int $quoteId)
{
$quoteIdFilter = $this->filterBuilder->setField('quote_id')
->setConditionType('eq')
Expand Down
Loading