From c149dd503fb1932761241bf7a108290e608e84d0 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 9 Feb 2024 01:03:16 +0000 Subject: [PATCH] Add daily email for 2024-02-07 Running tests in parallel with Paratest --- source/_daily_emails/2024-02-07.md | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 source/_daily_emails/2024-02-07.md diff --git a/source/_daily_emails/2024-02-07.md b/source/_daily_emails/2024-02-07.md new file mode 100644 index 000000000..e63fa802f --- /dev/null +++ b/source/_daily_emails/2024-02-07.md @@ -0,0 +1,36 @@ +--- +title: Running tests in parallel with Paratest +date: 2024-02-07 +permalink: archive/2024/02/07/running-tests-in-parallel-with-paratest +snippet: | + Run your tests quicker by executing them in parallel with Paratest. +tags: + - software-development + - automated-testing + - test-driven-development + - phpunit +--- + +{% block content %} +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][atdc], 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][issue] for using it for Drupal core's tests, which is something I'll keep an eye on and will look to contribute to. + +[atdc]: {{site.url}}/atdc +[issue]: https://www.drupal.org/project/drupal/issues/2781123 +[paratest]: https://github.com/paratestphp/paratest +{% endblock %} + +{% block cta %} +P.S. Do you need immediate access to an expert Drupal Developer? [With my Drupal development subscription][subscription], make unlimited requests for a fixed monthly price in less time than posting to a job board! + +[subscription]: {{site.url}}/subscription +{% endblock %}