In this episode, we take a quick look at how to run our tests in parallel using Pest within Laravel. Parallel testing can really help speed things up, especially as our test suite grows.
We start by trying out Pest's --parallel
option and see that we need to install the parallel plugin to make it work. After installing the plugin, we run our tests in parallel using both the --parallel
flag and the short p
command. Even though our current test suite is pretty small and we're not seeing dramatic speed improvements, it's worth noting that as your tests increase, you'll really start to notice the benefits.
We also check out how you can control the number of parallel processes Pest uses by specifying it in the command. This way, you can really maximize your system's resources for even faster test runs. For now, it's a quick win to set up, and will pay off more as your test suite gets bigger!