In less than 12 months, Drupal 7 will be end-of-life and no longer supported. Plan your upgrade to Drupal 10 now.

Running tests in parallel with Paratest

Something that I've recently added to my PHP projects is Paratest.

It adds parallel testing to PHPUnit, so your tests will be run in parallel instead of sequentially.

For the example module in my automated testing in Drupal email course, using Paratest reduces the execution time from ~16 seconds to ~8 seconds.

In a client project with 136 tests, it reduces the time from four and a half minutes to less than two minutes.

This is a big improvement just from running a single Composer command to add Paratest.

There's also an open issue for using it for Drupal core's tests, which is something I'll keep an eye on and will look to contribute to.

- Oliver

P.S. Do you need immediate access to an expert Drupal Developer? With my Drupal development subscription, make unlimited requests for a fixed monthly price in less time than posting to a job board!

Was this useful?

Sign up here and get more like this delivered straight to your inbox every day.

About me

Picture of Oliver

I'm an Acquia-certified Drupal Triple Expert with 17 years of experience, an open-source software maintainer and Drupal core contributor, public speaker, live streamer, and host of the Beyond Blocks podcast.