Parallel Testing is now in Laravel v8
Published on by Eric L. Barnes
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:
composer update nunomaduro/collision laravel/framework
Then, include the --parallel
flag when your tests:
php artisan test --parallel
Eric is the creator of Laravel News and has been covering Laravel since 2012.