Starting with Laravel v8.25, parallel testing is now available and the built-in
artisan test command adds support through a
--parallel flag. With this, it will run your tests simultaneously across multiple processes to significantly speed up the time required to run the entire test suite.
Here is how it’s described in the release notes:
As you may know, Laravel and PHPUnit execute your tests sequentially within a single process. However, a single process doesn’t use multiple cores; therefore, your test execution is seriously bottlenecked!
To mitigate this issue, we’re excited to announce that Parallel Testing is now available in Laravel. Starting Laravel v8.25, you may use the built-in test Artisan command to run your tests simultaneously across multiple processes to significantly reduce the time required to run the entire test suite.
To try this out today, be sure you are running the latest version of Collision and Laravel 8:
1composer update nunomaduro/collision laravel/framework
Then, include the
--parallel flag when your tests:
1php artisan test --parallel