Pest: Parallel Testing Is Now Available

Last updated 23/08/2021

Save precious time by running your tests concurrently with Pest!

This post is available in multiple languages thanks to the awesome Pest community!

🇮🇹 Italian 🇫🇷 French 🇵🇹 Portuguese

Fasten your seatbelts, people; today Pest is taking it to eleven with the introduction of the official Parallel Testing plugin! What's in it for you, and how can you get started?

Benefits of parallel testing

By default, Pest runs your tests in series. In simple terms, that means all of your tests will be queued up and run one after the other in a single PHP process. This can take a while, especially on large test suites.

However, unless your computer is from the '90s, it has many CPU cores that it can dispatch processes to. So, if there were a way to ask Pest to use more of those cores at once, our test suite could run an order of magnitude more quickly.

We are excited to announce that, as of today, there is a way to do exactly that! Pest now integrates with Paratest to provide this functionality in a completely seamless way!


To get started, you'll need to be running the latest version of Pest and the Pest Parallel plugin:

composer update pestphp/pest && composer require pestphp/pest-plugin-parallel --dev

Then, include the --parallel options when executing the pest command:

./vendor/bin/pest --parallel

Pest running in parallel mode

That's it! You're now running in parallel. If you want more tips and info, read on!

Tips and tricks

We've worked really hard to make Pest Parallel a seamless experience. This results in an experience that feels so Pesty.

For example, the parallel test output is identical to the standard test output, so you'll still get all of that beautiful rich reporting you're used to. Features like once and skip are fully supported, so no nasty error messages or warnings are to be expected.

Even Pest's beautiful coverage support is seamlessly integrated, for a beautiful testing experience:

./vendor/bin/pest --parallel --coverage --min=90

Pest's awesome coverage output is available in parallel too!

We've also worked hard to make sure Laravel has full Pest support, so as long as you have the Pest and the Pest Parallel plugin installed, you can run php artisan test --parallel and get all of that tasty Pest goodness for free.

Here's a cool tip: instead of writing --parallel every time, you can instead use the shorter -p option:

./vendor/bin/pest -p

By default, Pest will boot as many processes as you have cores on your computer. If you want to tweak that, you can pass the --processes option with the number of processes to use:

./vendor/bin/pest -p --processes=10

Use the --processes option to configure the number of processes

Going forwards

We're stoked to finally release parallel support. We've been working hard on that feature for a long time, and we know you're going to love it. We have a lot more in store for parallel in the future, including a full hook system, PhpStorm integration, compact printing modes, and more. We'll keep you posted!

In the meantime, sit back and enjoy the power of parallel testing in Pest!