Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
]
},
"require-dev": {
"ext-simplexml": "*",
"buggregator/trap": "^1.13.0",
"composer/composer": "^2.8.4",
"cweagans/composer-patches": "^2.0",
Expand Down Expand Up @@ -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",
"test:func": "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": "phpunit --testsuite=Acceptance --color=always --testdox"
"test:accept": "tests/runner.php vendor/bin/phpunit --testsuite=Acceptance --color=always --testdox"
},
"config": {
"sort-packages": true,
Expand Down
25 changes: 25 additions & 0 deletions tests/runner.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env php
<?php
Comment thread
roxblnfk marked this conversation as resolved.

declare(strict_types=1);

/**
* Sometimes Windows CI runner fails to report test results properly.
* This script is a workaround for that.
*/

$command = \implode(' ', \array_slice($argv, 1));
$logFile = 'runtime/phpunit.xml';

\passthru(\sprintf("%s %s --log-junit=%s 2>&1", PHP_BINARY, $command, $logFile), $code);

if (\file_exists($logFile)) {
$xml = \simplexml_load_file($logFile);
$failures = (int) $xml->testsuite['failures'] + (int) $xml->testsuite['errors'];

if ($failures === 0) {
exit(0);
}
}

exit($code ?: 1);
Loading