Skip to content

Commit 58b6c11

Browse files
committed
Add new workflow tests
1 parent d0088ab commit 58b6c11

11 files changed

+135
-146
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 & 9 deletions
This file was deleted.

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

Lines changed: 0 additions & 57 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 & 28 deletions
This file was deleted.

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

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

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

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Magento 2 Integration Tests
2+
#on: ['push', 'pull_request']
3+
on:
4+
release:
5+
push:
6+
branches:
7+
- 'main'
8+
9+
jobs:
10+
integration-tests:
11+
name: Magento 2 Integration Tests
12+
runs-on: self-hosted
13+
#runs-on: ubuntu-latest
14+
container:
15+
image: yireo/magento2installed:2.4.7-p4
16+
services:
17+
mysql:
18+
image: mysql:8.0
19+
env:
20+
MYSQL_ROOT_PASSWORD: root
21+
MYSQL_USER: magento2
22+
MYSQL_PASSWORD: magento2
23+
MYSQL_DATABASE: magento2
24+
options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping"
25+
opensearch:
26+
image: yireo/opensearch-dummy
27+
env:
28+
'discovery.type': single-node
29+
'xpack.security.enabled': false
30+
ES_JAVA_OPTS: "-Xms128m -Xmx128m"
31+
options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3
32+
redis:
33+
image: redis
34+
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
35+
steps:
36+
- name: Checkout sources
37+
uses: actions/checkout@v4
38+
39+
- name: Add module source
40+
run: |
41+
export COMPOSER_NAME=`cat .module.ini | grep COMPOSER_NAME | cut -f2 -d= | tr -d '"'`
42+
cp -R ${GITHUB_WORKSPACE} /tmp/magento/package-source
43+
cd /tmp/magento
44+
composer config repositories.local-source path package-source/
45+
composer require --prefer-source -- ${COMPOSER_NAME}:@dev
46+
47+
- name: Run Magento 2 Integration Tests
48+
run: |
49+
test -d $GITHUB_WORKSPACE/Test/Integration || exit 0
50+
export EXTENSION_VENDOR=`cat .module.ini | grep EXTENSION_VENDOR | cut -f2 -d= | tr -d '"'`
51+
export EXTENSION_NAME=`cat .module.ini | grep EXTENSION_NAME | cut -f2 -d= | tr -d '"'`
52+
export COMPOSER_NAME=`cat .module.ini | grep COMPOSER_NAME | cut -f2 -d= | tr -d '"'`
53+
export MAGENTO_MODULE=${EXTENSION_VENDOR}_${EXTENSION_NAME}
54+
cd /tmp/magento/dev/tests/integration/
55+
cp -R ${GITHUB_WORKSPACE}/.github/workflows/integration-tests/* .
56+
php -d memory_limit=4G ../../../vendor/bin/phpunit -c phpunit.xml ../../../vendor/$COMPOSER_NAME/Test/Integration
57+
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: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.6/phpunit.xsd"
4+
colors="true"
5+
beStrictAboutTestsThatDoNotTestAnything="false"
6+
bootstrap="./framework/bootstrap.php"
7+
stderr="true"
8+
>
9+
<php>
10+
<includePath>.</includePath>
11+
<includePath>testsuite</includePath>
12+
<ini name="date.timezone" value="America/Los_Angeles"/>
13+
<ini name="xdebug.max_nesting_level" value="200"/>
14+
<const name="TESTS_INSTALL_CONFIG_FILE" value="etc/install-config-mysql.php"/>
15+
<const name="TESTS_GLOBAL_CONFIG_FILE" value="etc/config-global.php"/>
16+
<const name="TESTS_GLOBAL_CONFIG_DIR" value="../../../app/etc"/>
17+
<const name="TESTS_CLEANUP" value="enabled"/>
18+
<const name="TESTS_POST_INSTALL_SETUP_COMMAND_CONFIG_FILE" value="etc/post-install-setup-command-config.php"/>
19+
<const name="TESTS_MEM_USAGE_LIMIT" value="4092M"/>
20+
<const name="TESTS_MEM_LEAK_LIMIT" value=""/>
21+
<const name="TESTS_EXTRA_VERBOSE_LOG" value="1"/>
22+
<const name="TESTS_MAGENTO_MODE" value="developer"/>
23+
<const name="TESTS_ERROR_LOG_LISTENER_LEVEL" value="-1"/>
24+
</php>
25+
<listeners>
26+
<listener class="Magento\TestFramework\Event\PhpUnit"/>
27+
<listener class="Magento\TestFramework\ErrorLog\Listener"/>
28+
</listeners>
29+
</phpunit>

0 commit comments

Comments
 (0)