Running Tests in Parallel

If you have set-up a node with several test commands and you would like to parallelize the different test commands, Scrutinizer makes this very easy.

Add Parallelism to a Single Node

When you have already set-up your test commands, you can simply add the on_node modifier to your test commands:

build:
    nodes:
        my-parallel-tests:
            dependencies:
                before:
                    - pecl install ssh-beta

            tests:
                override:
                    -
                        command: vendor/bin/phpunit tests/FolderA
                        on_node: 1

                    -
                        command: vendor/bin/phpunit tests/FolderB
                        on_node: 2

                    -
                        command: vendor/bin/phpunit tests/FolderC
                        on_node: 3

This configuration will execute your tests with 3-way parallelism, each of the test commands will be run in a separate node. The commands of other sections will be executed in all nodes.

Code coverage

Processing code coverage will work just as before when you were running just a single command. Scrutinizer automatically handles merging your data and does not require you to make any additional configuration.