News Feed

News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way
Parallel Testing for PHPUnit with ParaTest
June 07, 2013 @ 11:44:48

On today there's a new tutorial showing you how to use ParaTest for PHPUnit to execute your tests in parallel instead of the usual inline, in-order method.

PHPUnit has hinted at parallelism since 2007, but, in the meantime, our tests continue to run slowly. Time is money, right? ParaTest is a tool that sits on top of PHPUnit and allows you to run tests in parallel without the use of extensions. This is an ideal candidate for functional (i.e Selenium) tests and other long-running processes.

ParaTest operates as a separate binary that can easily be installed via Composer. They walk you through the install and show you what kind of options it lets you provide (like number of processes and the path to the PHPUnit executable). They show you how to write some parallel tests, five of them, each that sleeps for a certain amount of time. They also look at another tool that could help run your tests in parallel, Paraunit. They finish off the post with a look at some functional testing examples using Selenium, handling race conditions and some of the future plans for ParaTest's future.

0 comments voice your opinion now!
phpunit parallel testing paratest tutorial paraunit saucelabs

Contributing to Paratest
March 06, 2013 @ 10:16:00

On today there's an update about recent additions to Paratest, the parallel PHPUnit test runner (created by Brian Scaturro). He talks some about the benefits of running tests in parallel and shares some of the recent contributions to the project from other developers.

I've already written about my experiments with Paratest. Paratest is a PHPUnit wrapper that allows you to run tests written for PHPUnit in parallel, making us of multiple processes running on the same machine. In a world where cycle time is an important metric, trading resources to get the test suite to finish earlier is a net gain; especially when you're stepping on unstable stones and run the suite very often.

He (Giorgio Sironi) has contributed a new test runner to the project - the "WrapperRunner" that limits the number of processes spawned by the parallel testing tool. Another contribution came from Dimitris Baltas involving the addition of a TEST_TOKEN variable that can be used to uniquely identify each process as they're executing.

0 comments voice your opinion now!
contributions paratest parallel unittest phpunit runner multiprocess
Parallel PHPUnit
February 05, 2013 @ 13:35:16

On Giorgio Sironi has written up a new tutorial showing how to use parallelism with PHPUnit to execute multiple sets of tests at once, hoping for a performance gain.

Of course the cost of coordinating different processes is always going to be present, so we will never reach the theoretical speedup. I'll report later in this article some simulations. The most important constraints come from the design of our test suites. I can only think of two categories of tests as easily parallelizable: unit tests and Selenium tests.

He mentions one specific issue to watch out for - race conditions between the test sets (using the same backend resources). To help solve the issue, he recommends looking into Paratest, a tool that sits on top of PHPUnit and handles the execution of the tests in parallel. He creates some sample tests (they just compute values) and compares the runs of them in single- and multiple-process modes. The difference is a twenty-five percent drop in execution time for the parallel test runs.

0 comments voice your opinion now!
phpunit unittest parallel paratest project

Community Events

Don't see your event here?
Let us know!

framework release voicesoftheelephpant opinion extension laravel community library series introduction version language laravel5 php7 example unittest list podcast interview api

All content copyright, 2015 :: - Powered by the Solar PHP Framework