Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbaltas/5897533 to your computer and use it in GitHub Desktop.
Save dbaltas/5897533 to your computer and use it in GitHub Desktop.
Identify the Major Components of brianium/paratest

The objective of ParaTest is to support parallel testing in a variety of PHP testing tools.

We can split paratest tasks

  1. Identify the ExecutableTests to be run
  2. Run
  3. Collect output, parse and summarize

The List of Executable Tests

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

grouping ExecutableTests

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

Runners

PHPUnit Runner:

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

Wrapper Runner:

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

Output

Each ExecutableTest, upon completion, should deliver a test output to the main process The main process parses and summarizes all test outputs

Output Format

The output format is junit

Output Delivery Method

Each ExecutableTest stores the output in a directory accessible from the main process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment