Skip to content

Commit 8fc7a07

Browse files
authored
Merge branch 'master' into master
2 parents ac2676b + 8efb15f commit 8fc7a07

39 files changed

+636
-218
lines changed

.github/workflows/extdn-integration-tests-post-install.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/extdn-integration-tests-pre-install.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/workflows/extdn-integration-tests.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/extdn-phpstan-pre-install.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/extdn-phpstan.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/extdn-static-tests.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/extdn-unit-tests.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Magento 2 Integration Tests
2+
on: ['push', 'pull_request']
3+
4+
jobs:
5+
integration-tests:
6+
name: Magento 2 Integration Tests
7+
#runs-on: self-hosted
8+
runs-on: ubuntu-latest
9+
container:
10+
image: yireo/magento2installed:2.4.8-p3
11+
services:
12+
mysql:
13+
image: yireo/mariadb:10
14+
env:
15+
MYSQL_ROOT_PASSWORD: root
16+
MYSQL_USER: magento2
17+
MYSQL_PASSWORD: magento2
18+
MYSQL_DATABASE: magento2
19+
options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping"
20+
opensearch:
21+
image: yireo/opensearch:latest
22+
env:
23+
'discovery.type': single-node
24+
ES_JAVA_OPTS: "-Xms256m -Xmx256m"
25+
options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3
26+
redis:
27+
image: redis
28+
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
29+
steps:
30+
- name: Checkout sources
31+
uses: actions/checkout@v4
32+
33+
- name: Apply patch for reporting memory under Alpine
34+
run: cd /tmp/magento && curl -fsSL https://patch-diff.githubusercontent.com/raw/magento/magento2/pull/39216.diff | git apply
35+
36+
- name: Apply patch for changing MySQL client configuration
37+
run: cd /tmp/magento && curl -fsSL https://patch-diff.githubusercontent.com/raw/magento/magento2/pull/40410.diff | git apply
38+
39+
- name: Configure GitLab
40+
run: |
41+
test -n "${{ secrets.GITLAB_TOKEN }}" || exit 0
42+
cd /tmp/magento
43+
composer config --auth gitlab-token.gitlab.yireo.com ${{ secrets.GITLAB_TOKEN }}
44+
composer config repositories.loki-checkout composer https://gitlab.yireo.com/api/v4/group/loki-checkout/-/packages/composer/packages.json
45+
46+
- name: Add module source
47+
run: |
48+
export COMPOSER_NAME=`cat .module.ini | grep COMPOSER_NAME | cut -f2 -d= | tr -d '"'`
49+
cp -R ${GITHUB_WORKSPACE} /tmp/magento/package-source
50+
cd /tmp/magento
51+
composer config repositories.local-source path package-source/
52+
composer require --prefer-source -- ${COMPOSER_NAME}:@dev yireo/magento2-integration-test-helper
53+
54+
- name: Run Magento 2 Integration Tests
55+
run: |
56+
test -d $GITHUB_WORKSPACE/Test/Integration || exit 0
57+
export EXTENSION_VENDOR=`cat .module.ini | grep EXTENSION_VENDOR | cut -f2 -d= | tr -d '"'`
58+
export EXTENSION_NAME=`cat .module.ini | grep EXTENSION_NAME | cut -f2 -d= | tr -d '"'`
59+
export COMPOSER_NAME=`cat .module.ini | grep COMPOSER_NAME | cut -f2 -d= | tr -d '"'`
60+
export MAGENTO_MODULE=${EXTENSION_VENDOR}_${EXTENSION_NAME}
61+
cd /tmp/magento/dev/tests/integration/
62+
cp -R ${GITHUB_WORKSPACE}/.github/workflows/integration-tests/* .
63+
php ../../../vendor/bin/phpunit --atleast-version 9 && cp phpunit9.xml phpunit.xml
64+
php ../../../vendor/bin/phpunit --atleast-version 10 && cp phpunit10.xml phpunit.xml
65+
php -d memory_limit=4G ../../../vendor/bin/phpunit -c phpunit.xml ../../../vendor/$COMPOSER_NAME/Test/Integration
66+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php // phpcs:ignoreFile
2+
3+
use Yireo\IntegrationTestHelper\Utilities\DisableModules;
4+
use Yireo\IntegrationTestHelper\Utilities\InstallConfig;
5+
6+
$disableModules = (new DisableModules(__DIR__.'/../../../../'))
7+
->disableAll()
8+
->enableMagento()
9+
->disableByPattern('SampleData')
10+
->disableByPattern('Magento_TestModule')
11+
->disableMagentoInventory()
12+
->disableGraphQl()
13+
->enableByMagentoModuleEnv();
14+
15+
return (new InstallConfig())
16+
->setDisableModules($disableModules)
17+
->addDb('mysql', 'magento2', 'magento2', 'magento2')
18+
->addRedis('redis')
19+
->addElasticSearch('opensearch', 'opensearch', 9200)
20+
->get();
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
return [
3+
'client-mariadb' => [
4+
'disable-ssl',
5+
],
6+
];
7+

0 commit comments

Comments
 (0)