facile-it / paraunit

Run PHPUnit tests in parallel
https://engineering.facile.it/paraunit/
Apache License 2.0
135 stars 14 forks source link

Phpunit 9 #149

Closed Jean85 closed 4 years ago

Jean85 commented 4 years ago

~This is still WIP, it doesn't work for now.~

Due to some deprecations, I'm forced to change approach in how Paraunit collects the test results. This new approach uses the TestHook interfaces, ~which are cross-compatible from PHPUnit 7 up to 9~, but those will be injectable through CLI only from PHPUnit 9.1 thanks to https://github.com/sebastianbergmann/phpunit/pull/4136. This will mean that this PR will lead to a 1.1 release dropping PHPUnit < 9.1 support.

It will lead to a cleaner approach, but it requires a good overhaul of the Paraunit internals.

sebastianbergmann commented 4 years ago

With regards to test hooks: these will be superseded by the new event system @theseer, @localheinz, @epdenouden are working on (see https://github.com/theseer/phpunit/pull/1). This will hopefully be merged soon in time for PHPUnit 9.1 (or PHPUnit 9.2).

Test listeners were problematic, got deprecated, but so far have not been removed. Hooks were a lot better than listeners already, but still left a lot to be desired. Hooks will be deprecated when the event system is merged. Everything inside PHPUnit that currently still uses listeners will be refactored to use events. Then, hopefully in PHPUnit 10, both listeners and hooks will be removed.

Jean85 commented 4 years ago

Thanks for the heads up @sebastianbergmann! I'll look into it!

sebastianbergmann commented 4 years ago

You're welcome. Any feedback, especially on missing events, would be appreciated.

Jean85 commented 4 years ago

Opened https://github.com/theseer/phpunit/pull/2 on the new approach; it seems incomplete for now, but I can proceed with using TestHooks and reconvert them easily to event subscribers as soon as that approach lands into PHPUnit.