Skip to content

Commit 625a947

Browse files
committed
Upgrade tests
1 parent 0e9f7f5 commit 625a947

5 files changed

Lines changed: 114 additions & 21 deletions

File tree

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
name: Magento 2 Integration Tests
2-
#on: ['push', 'pull_request']
3-
on:
4-
release:
5-
push:
6-
branches:
7-
- 'main'
2+
on: ['push', 'pull_request']
83

94
jobs:
105
integration-tests:
116
name: Magento 2 Integration Tests
12-
runs-on: self-hosted
13-
#runs-on: ubuntu-latest
7+
#runs-on: self-hosted
8+
runs-on: ubuntu-latest
149
container:
15-
image: yireo/magento2installed:2.4.7-p4
10+
image: yireo/magento2installed:2.4.8-p3
1611
services:
1712
mysql:
1813
image: mysql:8.0
@@ -21,12 +16,11 @@ jobs:
2116
MYSQL_USER: magento2
2217
MYSQL_PASSWORD: magento2
2318
MYSQL_DATABASE: magento2
24-
options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping"
19+
options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping"
2520
opensearch:
26-
image: yireo/opensearch-dummy
21+
image: yireo/opensearch:latest
2722
env:
2823
'discovery.type': single-node
29-
#'xpack.security.enabled': false
3024
ES_JAVA_OPTS: "-Xms256m -Xmx256m"
3125
options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3
3226
redis:
@@ -36,13 +30,21 @@ jobs:
3630
- name: Checkout sources
3731
uses: actions/checkout@v4
3832

33+
- name: Enable log_bin_trust_function_creators
34+
run: mysql -h mysql -uroot -proot -e "SET GLOBAL log_bin_trust_function_creators=1;"
35+
36+
- name: Configure GitLab
37+
run: |
38+
test -n "${{ secrets.GITLAB_TOKEN }}" || exit 0
39+
cd /tmp/magento
40+
composer config --auth gitlab-token.gitlab.yireo.com ${{ secrets.GITLAB_TOKEN }}
41+
composer config repositories.loki-checkout composer https://gitlab.yireo.com/api/v4/group/loki-checkout/-/packages/composer/packages.json
42+
3943
- name: Add module source
4044
run: |
4145
export COMPOSER_NAME=`cat .module.ini | grep COMPOSER_NAME | cut -f2 -d= | tr -d '"'`
4246
cp -R ${GITHUB_WORKSPACE} /tmp/magento/package-source
4347
cd /tmp/magento
44-
composer config --auth gitlab-token.gitlab.yireo.com ${{ secrets.GITLAB_TOKEN }}
45-
composer config repositories.loki-checkout composer https://gitlab.yireo.com/api/v4/group/loki-checkout/-/packages/composer/packages.json
4648
composer config repositories.local-source path package-source/
4749
composer require --prefer-source -- ${COMPOSER_NAME}:@dev yireo/magento2-integration-test-helper
4850
@@ -55,5 +57,7 @@ jobs:
5557
export MAGENTO_MODULE=${EXTENSION_VENDOR}_${EXTENSION_NAME}
5658
cd /tmp/magento/dev/tests/integration/
5759
cp -R ${GITHUB_WORKSPACE}/.github/workflows/integration-tests/* .
60+
php ../../../vendor/bin/phpunit --atleast-version 9 && cp phpunit9.xml phpunit.xml
61+
php ../../../vendor/bin/phpunit --atleast-version 10 && cp phpunit10.xml phpunit.xml
5862
php -d memory_limit=4G ../../../vendor/bin/phpunit -c phpunit.xml ../../../vendor/$COMPOSER_NAME/Test/Integration
5963
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
10+
colors="true"
11+
columns="max"
12+
beStrictAboutTestsThatDoNotTestAnything="false"
13+
bootstrap="./framework/bootstrap.php"
14+
stderr="true">
15+
<testsuites>
16+
<testsuite name="LokiCheckout">
17+
<directory>../../../app/code/Yireo/LokiCheckout*/Test/Integration</directory>
18+
<directory>../../../vendor/yireo/magento2-loki-checkout*/Test/Integration</directory>
19+
</testsuite>
20+
</testsuites>
21+
<php>
22+
<includePath>.</includePath>
23+
<includePath>testsuite</includePath>
24+
<ini name="date.timezone" value="America/Los_Angeles"/>
25+
<ini name="xdebug.max_nesting_level" value="200"/>
26+
<const name="TESTS_INSTALL_CONFIG_FILE" value="etc/install-config-mysql.php"/>
27+
<const name="TESTS_GLOBAL_CONFIG_FILE" value="etc/config-global.php"/>
28+
<const name="TESTS_GLOBAL_CONFIG_DIR" value="../../../app/etc"/>
29+
<const name="TESTS_POST_INSTALL_SETUP_COMMAND_CONFIG_FILE" value="etc/post-install-setup-command-config.php"/>
30+
<const name="TESTS_CLEANUP" value="enabled"/>
31+
<const name="TESTS_MEM_USAGE_LIMIT" value="8192M"/>
32+
<const name="TESTS_MEM_LEAK_LIMIT" value=""/>
33+
<const name="TESTS_EXTRA_VERBOSE_LOG" value="1"/>
34+
<const name="TESTS_MAGENTO_MODE" value="developer"/>
35+
<const name="TESTS_ERROR_LOG_LISTENER_LEVEL" value="-1"/>
36+
<const name="USE_OVERRIDE_CONFIG" value="enabled"/>
37+
</php>
38+
<extensions>
39+
<bootstrap class="Magento\TestFramework\Event\Subscribers"/>
40+
</extensions>
41+
</phpunit>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
<testsuites>
10+
<testsuite name="LokiCheckout">
11+
<directory>../../../app/code/Yireo/LokiCheckout*/Test/Integration</directory>
12+
<directory>../../../vendor/yireo/magento2-loki-checkout*/Test/Integration</directory>
13+
</testsuite>
14+
</testsuites>
15+
<php>
16+
<includePath>.</includePath>
17+
<includePath>testsuite</includePath>
18+
<ini name="date.timezone" value="America/Los_Angeles"/>
19+
<ini name="xdebug.max_nesting_level" value="200"/>
20+
<const name="TESTS_INSTALL_CONFIG_FILE" value="etc/install-config-mysql.php"/>
21+
<const name="TESTS_GLOBAL_CONFIG_FILE" value="etc/config-global.php"/>
22+
<const name="TESTS_GLOBAL_CONFIG_DIR" value="../../../app/etc"/>
23+
<const name="TESTS_POST_INSTALL_SETUP_COMMAND_CONFIG_FILE" value="etc/post-install-setup-command-config.php"/>
24+
<const name="TESTS_CLEANUP" value="enabled"/>
25+
<const name="TESTS_MEM_USAGE_LIMIT" value="8192M"/>
26+
<const name="TESTS_MEM_LEAK_LIMIT" value=""/>
27+
<const name="TESTS_EXTRA_VERBOSE_LOG" value="1"/>
28+
<const name="TESTS_MAGENTO_MODE" value="developer"/>
29+
<const name="TESTS_ERROR_LOG_LISTENER_LEVEL" value="-1"/>
30+
</php>
31+
<listeners>
32+
<listener class="Magento\TestFramework\Event\PhpUnit"/>
33+
<listener class="Magento\TestFramework\ErrorLog\Listener"/>
34+
</listeners>
35+
</phpunit>

.github/workflows/static-tests.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,29 @@ on: ['push', 'pull_request']
44
jobs:
55
static-tests:
66
name: Magento 2 Static Tests
7-
runs-on: self-hosted
8-
#runs-on: ubuntu-latest
7+
#runs-on: self-hosted
8+
runs-on: ubuntu-latest
99
container:
10-
image: yireo/magento2installed:2.4.7-p4
10+
image: yireo/magento2installed:2.4.8-p3
1111
steps:
1212
- name: Checkout sources
1313
uses: actions/checkout@v4
1414

15+
- name: Configure GitLab
16+
run: |
17+
test -n "${{ secrets.GITLAB_TOKEN }}" || exit 0
18+
cd /tmp/magento
19+
composer config --auth gitlab-token.gitlab.yireo.com ${{ secrets.GITLAB_TOKEN }}
20+
composer config repositories.loki-checkout composer https://gitlab.yireo.com/api/v4/group/loki-checkout/-/packages/composer/packages.json
21+
1522
- name: Add module source
1623
run: |
1724
export COMPOSER_NAME=`cat .module.ini | grep COMPOSER_NAME | cut -f2 -d= | tr -d '"'`
1825
cp -R ${GITHUB_WORKSPACE} /tmp/magento/package-source
1926
cd /tmp/magento
2027
composer config repositories.local-source path package-source/
2128
composer config --no-plugins allow-plugins true
22-
composer require --prefer-source -- ${COMPOSER_NAME}:@dev
29+
composer require --prefer-source -- ${COMPOSER_NAME}:@dev yireo/magento2-integration-test-helper
2330
composer require --dev --prefer-source -- phpstan/phpstan bitexpert/phpstan-magento phpstan/extension-installer
2431
2532
- name: Run Magento 2 PHPStan Tests

.github/workflows/unit-tests.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,27 @@ on: ['push', 'pull_request']
44
jobs:
55
unit-tests:
66
name: Magento 2 Unit Tests
7+
#runs-on: self-hosted
78
runs-on: ubuntu-latest
89
container:
9-
image: yireo/magento2installed:2.4.7-p4
10+
image: yireo/magento2installed:2.4.8-p3
1011
steps:
1112
- name: Checkout sources
1213
uses: actions/checkout@v4
1314

15+
- name: Configure GitLab
16+
run: |
17+
test -n "${{ secrets.GITLAB_TOKEN }}" || exit 0
18+
cd /tmp/magento
19+
composer config --auth gitlab-token.gitlab.yireo.com ${{ secrets.GITLAB_TOKEN }}
20+
composer config repositories.loki-checkout composer https://gitlab.yireo.com/api/v4/group/loki-checkout/-/packages/composer/packages.json
21+
1422
- name: Add module source
1523
run: |
1624
export COMPOSER_NAME=`cat .module.ini | grep COMPOSER_NAME | cut -f2 -d= | tr -d '"'`
1725
test -z "$COMPOSER_NAME}" && (echo "No composer name found" && exit 1)
1826
cp -R $GITHUB_WORKSPACE /tmp/magento/package-source
1927
cd /tmp/magento
20-
composer config --auth gitlab-token.gitlab.yireo.com ${{ secrets.GITLAB_TOKEN }}
21-
composer config repositories.loki-checkout composer https://gitlab.yireo.com/api/v4/group/loki-checkout/-/packages/composer/packages.json
2228
composer config repositories.local-source path package-source/
2329
composer require --prefer-source -W -- $COMPOSER_NAME:@dev
2430

0 commit comments

Comments
 (0)