The objective of ParaTest is to support parallel testing in a variety of PHP testing tools.
We can split paratest tasks
- Identify the ExecutableTests to be run
- Run
- Collect output, parse and summarize
Identify the test suites that need to be executed For each suite identify the test files. Take into consideration the following filtering options
--filter <pattern> Filter which tests to run.
--testsuite <pattern> Filter which testsuite to run.
--group ... Only runs tests from the specified group(s).
--exclude-group ... Exclude tests from the specified group(s).
--test-suffix ... Only search for test in files with specified
suffix(es). Default: Test.php,.phpt
ExecutableTest is a collection of Test Cases. The ExecutableTest can include all test methods of a Test File on default mode On functional mode, each method is an ExecutableTest as long as there are no dependent tests. On functional mode with dependent tests an ExecutableTest may contain multiple methods that all depend on or are dependencies to other methods of the same ExecutableTest
Main Process has a loop that ensures that p processes are each processing an ExecutableTest When an ExecutableTest is executed, the process dies and the main process adds another one in its place The runner uses a pending array for all ExecutableTest in queue and a running array for all those currently running
Main process opens p processes Main process ensures that each process is processing one ExecutableTest at a time. When the process executes the ExecutableTest then it becomes idle and the main process
Each ExecutableTest, upon completion, should deliver a test output to the main process The main process parses and summarizes all test outputs
The output format is junit
Each ExecutableTest stores the output in a directory accessible from the main process