Skip to content

Commit

Permalink
[ECP-9152] Update Magento versions on the workflows (#2623)
Browse files Browse the repository at this point in the history
* [ECP-9152] Use OpenSearch and PHP 8.3

* [ECP-9152] Define OpenSearch environment variables

* [ECP-9152] Update container name

* [ECP-9152] Use Bitnami image of OpenSearch

* [ECP-9152] Remove redundant variable

* [ECP-9152] Implement matrix for test workflows

* [ECP-9152] Bump Magento 2 version

* [ECP-9152] Update test init command

* [ECP-9152] Fix MFTF tests

* [ECP-9152] Downgrade Magento 2 version

* Revert "[ECP-9152] Update test init command"

This reverts commit b91b035.

* [ECP-9152] Update test matrix for workflows

* [ECP-9152] Downgrade PHP version

* Bump Magento version in REST functional tests

---------

Co-authored-by: Can Demiralp <[email protected]>
Co-authored-by: Peter Ojo <[email protected]>
  • Loading branch information
3 people authored Sep 30, 2024
1 parent 4c4378c commit 4b98628
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 36 deletions.
8 changes: 4 additions & 4 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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] \
Expand Down
1 change: 0 additions & 1 deletion .github/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ setup-mftf:
--MAGENTO_BASE_URL "https://${MAGENTO_HOST}/" \
--MAGENTO_BACKEND_NAME "${ADMIN_URLEXT}" \
--MAGENTO_ADMIN_USERNAME "${ADMIN_USERNAME}" \
--MAGENTO_ADMIN_PASSWORD "${ADMIN_PASSWORD}" \
--BROWSER chrome \
--ELASTICSEARCH_VERSION 7;
echo 'SELENIUM_HOST=selenium' >> dev/tests/acceptance/.env;
Expand Down
10 changes: 5 additions & 5 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ services:
MARIADB_DATABASE: magento
MARIADB_USER: magento
MARIADB_PASSWORD: magento
elastic:
image: elasticsearch:7.17.23
container_name: elasticsearch
opensearch:
image: bitnami/opensearch:2
container_name: opensearch-container
networks:
- backend
ports:
Expand All @@ -37,7 +37,7 @@ services:
- magento2.test.com
environment:
DB_SERVER: mariadb
ELASTICSEARCH_SERVER: elasticsearch
OPENSEARCH_SERVER: opensearch-container
MAGENTO_HOST: magento2.test.com
VIRTUAL_HOST: magento2.test.com
COMPOSER_MEMORY_LIMIT: -1
Expand All @@ -52,7 +52,7 @@ services:
MAGENTO_VERSION:
depends_on:
- db
- elastic
- opensearch
volumes:
- ../:/data/extensions/workdir
- ./Makefile:/var/www/html/Makefile
Expand Down
24 changes: 10 additions & 14 deletions .github/scripts/install_magento.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,25 @@ else
exit 1
fi

USE_ELASTICSEARCH='1'
if [[ "$MAGENTO_VERSION" =~ ^2\.3 ]]; then
USE_ELASTICSEARCH='0'
fi

if [ "$USE_ELASTICSEARCH" == '1' ] && [ "$ELASTICSEARCH_SERVER" != "<will be defined>" ]; then
if [ "$OPENSEARCH_SERVER" != "<will be defined>" ]; then
MAGENTO_INSTALL_ARGS=$(echo \
--elasticsearch-host="$ELASTICSEARCH_SERVER" \
--elasticsearch-port="$ELASTICSEARCH_PORT" \
--elasticsearch-index-prefix="$ELASTICSEARCH_INDEX_PREFIX" \
--elasticsearch-timeout="$ELASTICSEARCH_TIMEOUT")
--search-engine="opensearch" \
--opensearch-host="$OPENSEARCH_SERVER" \
--opensearch-port="$OPENSEARCH_PORT" \
--opensearch-index-prefix="$OPENSEARCH_INDEX_PREFIX" \
--opensearch-timeout="$OPENSEARCH_TIMEOUT")
RET=1
while [ $RET -ne 0 ]; do
echo "Checking if $ELASTICSEARCH_SERVER is available."
curl -XGET "$ELASTICSEARCH_SERVER:$ELASTICSEARCH_PORT/_cat/health?v&pretty" >/dev/null 2>&1
echo "Checking if $OPENSEARCH_SERVER is available."
curl -XGET "$OPENSEARCH_SERVER:$OPENSEARCH_PORT/_cat/health?v&pretty" >/dev/null 2>&1
RET=$?

if [ $RET -ne 0 ]; then
echo "Connection to Elasticsearch is pending."
echo "Connection to OpenSearch is pending."
sleep 5
fi
done
echo "Elasticsearch server $ELASTICSEARCH_SERVER is available."
echo "OpenSearch server $OPENSEARCH_SERVER is available."
fi

if [[ -e /tmp/magento.tar.gz ]]; then
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-test-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
labels: ubuntu-latest-8-cores
timeout-minutes: 25
env:
PHP_VERSION: "8.1"
MAGENTO_VERSION: "2.4.5"
PHP_VERSION: "8.3"
MAGENTO_VERSION: "2.4.7-p2"
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-test-express-checkout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
labels: ubuntu-latest-8-cores
timeout-minutes: 20
env:
PHP_VERSION: "8.1"
MAGENTO_VERSION: "2.4.5"
PHP_VERSION: "8.3"
MAGENTO_VERSION: "2.4.7-p2"
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}}
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ jobs:
build:
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:
matrix:
php-version: ["8.3"]
magento-version: ["2.4.7-p2"]
runs-on:
group: larger-runners
labels: ubuntu-latest-8-cores
timeout-minutes: 25
env:
PHP_VERSION: "8.1"
MAGENTO_VERSION: "2.4.5"
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}}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/graphql-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'external' || 'internal' }}
strategy:
matrix:
php-version: ["8.1"]
magento-version: ["2.4.5"]
php-version: ["8.2"]
magento-version: ["2.4.6-p7"]
runs-on: ubuntu-latest
env:
PHP_VERSION: ${{ matrix.php-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mftf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
strategy:
matrix:
include:
- php-version: '8.1'
magento-version: '2.4.5'
- php-version: '8.3'
magento-version: '2.4.7-p2'
runs-on: ubuntu-latest
env:
PHP_VERSION: ${{ matrix.php-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/restapi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'external' || 'internal' }}
strategy:
matrix:
php-version: ["8.1"]
magento-version: ["2.4.5"]
php-version: [8.3]
magento-version: [2.4.7-p2]
runs-on: ubuntu-latest
env:
PHP_VERSION: ${{ matrix.php-version }}
Expand Down

0 comments on commit 4b98628

Please sign in to comment.