medology/phpunit-parallel-runner

This package is abandoned and no longer maintained. No replacement package was suggested.

Parallel (Node) Runner for PHPUnit

dev-master 2020-06-19 17:26 UTC

This package is auto-updated.

Last update: 2020-08-19 17:51:03 UTC


README

Build Status Code Climate Test Coverage

PHPUnit Parallel (Node) Runner

A parallelizer for running PHPUnit on multiple nodes. While many plugins exist to run PHPUnit in parallel processes, this extensions allows for running PHPUnit in parallel on multiple nodes. This is often required in various CI services such as CircleCI and TravisCI.

Dependencies

PHPUnit >= 7.5

Legacy support

The development environment for this project is configured using docker, removing the need to actually install anything on your maching. Simply install the Docker Engine and use the scripts in bin/.

Usage

An entrypoint script is packaged with the extension (entitle phpunit-parallel.php). This can be run with the arguments --current-node and --total-nodes representing the index of the node in the cluster (numbered 0-n) and the total number of nodes in the cluster (n), respectively.

The --current-node option expects a 0-indexed value. That is for a cluster with 3 nodes, the node indexes would be 0, 1, and 2.

Example Usage

> phpunit-parallel.php --current-node=0 --total-nodes=1 tests/
> phpunit-parallel.php --current-node=2 --total-nodes=5 tests/
> phpunit-parallel.php --current-node=1 --total-nodes=2 --configuration phpunit.xml

Development Setup

  1. Clone the repository
  2. In the project root run composer
> bin/init_project
  1. Run the unit tests packaged with this extension
> bin/phpunit