paratestphp / paratest

:computer: Parallel testing for PHPUnit
MIT License
2.31k stars 228 forks source link

Paratest v7.3.1 exit code no longer working with PHPUnit >10.5.30 #889

Closed adnweedon closed 1 month ago

adnweedon commented 1 month ago

| ParaTest version | 7.3.1 | PHPUnit version | 10.5.30 | PHP version | 8.1

Summary

Since the PHPUnit 10.5.31 update, Paratest still runs perfectly, but the exit code is broken, because the return type has changed! Unfortunately, this means that our CI pipelines are no longer working, because although the tests are running fine, the exit code is no longer correct, so it is showing failures when everything is fine!

I understand that you're only maintaining the most recent versions, so get it if this just gets closed, but I thought I'd raise it in case there's interest in fixing it or locking the phpunit version!

Current behavior

It throws a TypeError when it finishes, even though tests have passed fine.

PHP Fatal error: Uncaught TypeError: PHPUnit\TextUI\ShellExitCodeCalculator::calculate(): Argument #8 ($failOnWarning) must be of type bool, PHPUnit\TestRunner\TestResult\TestResult given, called in /var/www/html/vendor/brianium/paratest/src/WrapperRunner/WrapperRunner.php on line 295 and defined in /var/www/html/vendor/phpunit/phpunit/src/TextUI/ShellExitCodeCalculator.php:25

How to reproduce: command, code and error stack trace

On PHP8.1, update PHPUnit to 10.5.31 or above, and run paratest.

Expected behavior

The exit code should work!

Thanks for your work on paratest - we really appreciate it!

Slamdunk commented 1 month ago

This error has been fixed in v7.4.6 and v7.5.4 for PHPUnit 10 and 11 respectively, both of which require PHP 8.2