From df00dd9167163b266557dc60ee769b8a0243923d Mon Sep 17 00:00:00 2001 From: Dmitriy Derepko Date: Thu, 29 Jan 2026 13:32:47 +0400 Subject: [PATCH 1/8] fix: upgrade symfony/process lowest version to 5.4.51 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 73c535ae4..2fcd28a57 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "symfony/filesystem": "^5.4.45 || ^6.4.13 || ^7.0 || ^8.0", "symfony/http-client": "^5.4.49 || ^6.4.17 || ^7.0 || ^8.0", "symfony/polyfill-php83": "^1.31.0", - "symfony/process": "^5.4.47 || ^6.4.15 || ^7.0 || ^8.0" + "symfony/process": "^5.4.51 || ^6.4.15 || ^7.0 || ^8.0" }, "autoload": { "psr-4": { From d4f381eb62497dd97ef8f96c0d757aa93e364108 Mon Sep 17 00:00:00 2001 From: Dmitriy Derepko Date: Thu, 29 Jan 2026 13:48:11 +0400 Subject: [PATCH 2/8] test: handle non-zero exit codes when tests succeed --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 2fcd28a57..56bcb855f 100644 --- a/composer.json +++ b/composer.json @@ -98,10 +98,10 @@ "cs:fix": "php-cs-fixer fix -v", "psalm": "psalm", "psalm:baseline": "psalm --set-baseline=psalm-baseline.xml", - "test:unit": "phpunit --testsuite=Unit --color=always --testdox", - "test:func": "phpunit --testsuite=Functional --color=always --testdox", + "test:unit": "phpunit --testsuite=Unit --color=always --testdox 2>&1 | tee ./runtime/phpunit-unit.log; code=$?; sed 's/\\x1b\\[[0-9;]*m//g' ./runtime/phpunit-unit.log | grep -qE '^OK \\([0-9]+ tests?, [0-9]+ assertions?\\)|^OK, but some tests were skipped!' && exit 0 || exit $code", + "test:func": "phpunit --testsuite=Functional --color=always --testdox 2>&1 | tee ./runtime/phpunit-functional.log; code=$?; sed 's/\\x1b\\[[0-9;]*m//g' ./runtime/phpunit-functional.log | grep -qE '^OK \\([0-9]+ tests?, [0-9]+ assertions?\\)|^OK, but some tests were skipped!' && exit 0 || exit $code", "test:arch": "phpunit --testsuite=Arch --color=always --testdox", - "test:accept": "phpunit --testsuite=Acceptance --color=always --testdox" + "test:accept": "phpunit --testsuite=Acceptance --color=always --testdox 2>&1 | tee ./runtime/phpunit-acceptance.log; code=$?; sed 's/\\x1b\\[[0-9;]*m//g' ./runtime/phpunit-acceptance.log | grep -qE '^OK \\([0-9]+ tests?, [0-9]+ assertions?\\)|^OK, but some tests were skipped!' && exit 0 || exit $code" }, "config": { "sort-packages": true, From 47d5107b4a56b3069c849c8654e7fde6eec1491a Mon Sep 17 00:00:00 2001 From: Dmitriy Derepko Date: Thu, 29 Jan 2026 14:06:30 +0400 Subject: [PATCH 3/8] test: add test runner --- composer.json | 7 ++++--- tests/ci-runner.php | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 tests/ci-runner.php diff --git a/composer.json b/composer.json index 56bcb855f..1b3cf7cbb 100644 --- a/composer.json +++ b/composer.json @@ -56,6 +56,7 @@ ] }, "require-dev": { + "ext-simplexml": "*", "buggregator/trap": "^1.13.0", "composer/composer": "^2.8.4", "cweagans/composer-patches": "^2.0", @@ -98,10 +99,10 @@ "cs:fix": "php-cs-fixer fix -v", "psalm": "psalm", "psalm:baseline": "psalm --set-baseline=psalm-baseline.xml", - "test:unit": "phpunit --testsuite=Unit --color=always --testdox 2>&1 | tee ./runtime/phpunit-unit.log; code=$?; sed 's/\\x1b\\[[0-9;]*m//g' ./runtime/phpunit-unit.log | grep -qE '^OK \\([0-9]+ tests?, [0-9]+ assertions?\\)|^OK, but some tests were skipped!' && exit 0 || exit $code", - "test:func": "phpunit --testsuite=Functional --color=always --testdox 2>&1 | tee ./runtime/phpunit-functional.log; code=$?; sed 's/\\x1b\\[[0-9;]*m//g' ./runtime/phpunit-functional.log | grep -qE '^OK \\([0-9]+ tests?, [0-9]+ assertions?\\)|^OK, but some tests were skipped!' && exit 0 || exit $code", + "test:unit": "php tests/ci-runner.php ./vendor/bin/phpunit --testsuite=Unit --color=always --testdox", + "test:func": "php tests/ci-runner.php ./vendor/bin/phpunit --testsuite=Functional --color=always --testdox", "test:arch": "phpunit --testsuite=Arch --color=always --testdox", - "test:accept": "phpunit --testsuite=Acceptance --color=always --testdox 2>&1 | tee ./runtime/phpunit-acceptance.log; code=$?; sed 's/\\x1b\\[[0-9;]*m//g' ./runtime/phpunit-acceptance.log | grep -qE '^OK \\([0-9]+ tests?, [0-9]+ assertions?\\)|^OK, but some tests were skipped!' && exit 0 || exit $code" + "test:accept": "php tests/ci-runner.php ./vendor/bin/phpunit --testsuite=Acceptance --color=always --testdox" }, "config": { "sort-packages": true, diff --git a/tests/ci-runner.php b/tests/ci-runner.php new file mode 100644 index 000000000..0244294b9 --- /dev/null +++ b/tests/ci-runner.php @@ -0,0 +1,24 @@ +&1", $code); + +if (\file_exists($logFile)) { + $xml = \simplexml_load_file($logFile); + $failures = (int) $xml['failures'] + (int) $xml['errors']; + + if ($failures === 0) { + exit(0); + } +} + +exit($code ?: 1); From 414cc4f786a3f959d35791ca3d784365449bf4b5 Mon Sep 17 00:00:00 2001 From: Dmitriy Derepko Date: Thu, 29 Jan 2026 14:09:40 +0400 Subject: [PATCH 4/8] test: windows suitable path --- composer.json | 6 +++--- tests/ci-runner.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 1b3cf7cbb..8e09d710f 100644 --- a/composer.json +++ b/composer.json @@ -99,10 +99,10 @@ "cs:fix": "php-cs-fixer fix -v", "psalm": "psalm", "psalm:baseline": "psalm --set-baseline=psalm-baseline.xml", - "test:unit": "php tests/ci-runner.php ./vendor/bin/phpunit --testsuite=Unit --color=always --testdox", - "test:func": "php tests/ci-runner.php ./vendor/bin/phpunit --testsuite=Functional --color=always --testdox", + "test:unit": "php tests/ci-runner.php vendor/bin/phpunit --testsuite=Unit --color=always --testdox", + "test:func": "php tests/ci-runner.php vendor/bin/phpunit --testsuite=Functional --color=always --testdox", "test:arch": "phpunit --testsuite=Arch --color=always --testdox", - "test:accept": "php tests/ci-runner.php ./vendor/bin/phpunit --testsuite=Acceptance --color=always --testdox" + "test:accept": "php tests/ci-runner.php vendor/bin/phpunit --testsuite=Acceptance --color=always --testdox" }, "config": { "sort-packages": true, diff --git a/tests/ci-runner.php b/tests/ci-runner.php index 0244294b9..a668dbf20 100644 --- a/tests/ci-runner.php +++ b/tests/ci-runner.php @@ -8,7 +8,7 @@ */ $command = \implode(' ', \array_slice($argv, 1)); -$logFile = './runtime/phpunit.xml'; +$logFile = 'runtime/phpunit.xml'; \passthru("$command --log-junit=$logFile 2>&1", $code); From 850e016e426d1dd9c991d86abc1456c1b185e374 Mon Sep 17 00:00:00 2001 From: Dmitriy Derepko Date: Thu, 29 Jan 2026 14:13:51 +0400 Subject: [PATCH 5/8] test: pass php exucutable --- tests/ci-runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ci-runner.php b/tests/ci-runner.php index a668dbf20..26e0d1193 100644 --- a/tests/ci-runner.php +++ b/tests/ci-runner.php @@ -10,7 +10,7 @@ $command = \implode(' ', \array_slice($argv, 1)); $logFile = 'runtime/phpunit.xml'; -\passthru("$command --log-junit=$logFile 2>&1", $code); +\passthru("php $command --log-junit=$logFile 2>&1", $code); if (\file_exists($logFile)) { $xml = \simplexml_load_file($logFile); From 6ca7592aac89e10475691c3126daa76e84546c5b Mon Sep 17 00:00:00 2001 From: Dmitriy Derepko Date: Thu, 29 Jan 2026 14:19:57 +0400 Subject: [PATCH 6/8] test: fix xml element access --- tests/ci-runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ci-runner.php b/tests/ci-runner.php index 26e0d1193..155f75879 100644 --- a/tests/ci-runner.php +++ b/tests/ci-runner.php @@ -14,7 +14,7 @@ if (\file_exists($logFile)) { $xml = \simplexml_load_file($logFile); - $failures = (int) $xml['failures'] + (int) $xml['errors']; + $failures = (int) $xml->testsuite['failures'] + (int) $xml->testsuite['errors']; if ($failures === 0) { exit(0); From ff10ea996667aad6c142ad05f5d93f5913ae0534 Mon Sep 17 00:00:00 2001 From: Dmitriy Derepko Date: Thu, 29 Jan 2026 14:24:25 +0400 Subject: [PATCH 7/8] test: use PHP_BINARY for passing php executable to passthru command --- tests/ci-runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ci-runner.php b/tests/ci-runner.php index 155f75879..bc0b26eee 100644 --- a/tests/ci-runner.php +++ b/tests/ci-runner.php @@ -10,7 +10,7 @@ $command = \implode(' ', \array_slice($argv, 1)); $logFile = 'runtime/phpunit.xml'; -\passthru("php $command --log-junit=$logFile 2>&1", $code); +\passthru(\sprintf("%s %s --log-junit=%s 2>&1", PHP_BINARY, $command, $logFile), $code); if (\file_exists($logFile)) { $xml = \simplexml_load_file($logFile); From 8398d2dd8a7b8c516afde534c83e237b92dda9dd Mon Sep 17 00:00:00 2001 From: Dmitriy Derepko Date: Thu, 29 Jan 2026 15:32:11 +0400 Subject: [PATCH 8/8] test: rename file, add shebang --- composer.json | 6 +++--- tests/{ci-runner.php => runner.php} | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) rename tests/{ci-runner.php => runner.php} (96%) mode change 100644 => 100755 diff --git a/composer.json b/composer.json index 8e09d710f..e9fba1200 100644 --- a/composer.json +++ b/composer.json @@ -99,10 +99,10 @@ "cs:fix": "php-cs-fixer fix -v", "psalm": "psalm", "psalm:baseline": "psalm --set-baseline=psalm-baseline.xml", - "test:unit": "php tests/ci-runner.php vendor/bin/phpunit --testsuite=Unit --color=always --testdox", - "test:func": "php tests/ci-runner.php vendor/bin/phpunit --testsuite=Functional --color=always --testdox", + "test:unit": "tests/runner.php vendor/bin/phpunit --testsuite=Unit --color=always --testdox", + "test:func": "tests/runner.php vendor/bin/phpunit --testsuite=Functional --color=always --testdox", "test:arch": "phpunit --testsuite=Arch --color=always --testdox", - "test:accept": "php tests/ci-runner.php vendor/bin/phpunit --testsuite=Acceptance --color=always --testdox" + "test:accept": "tests/runner.php vendor/bin/phpunit --testsuite=Acceptance --color=always --testdox" }, "config": { "sort-packages": true, diff --git a/tests/ci-runner.php b/tests/runner.php old mode 100644 new mode 100755 similarity index 96% rename from tests/ci-runner.php rename to tests/runner.php index bc0b26eee..b8aabb98c --- a/tests/ci-runner.php +++ b/tests/runner.php @@ -1,3 +1,4 @@ +#!/usr/bin/env php