medology / phpunit-parallel-runner
Parallel (Node) Runner for PHPUnit
Requires
- php: ^7.1
- phpunit/phpunit: ~7.5
Requires (Dev)
- symfony/yaml: ^4.3
This package is auto-updated.
Last update: 2020-08-19 17:51:03 UTC
README
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
- Clone the repository
- In the project root run composer
> bin/init_project
- Run the unit tests packaged with this extension
> bin/phpunit