MediaWiki master
|
Launch PHPUnit test suites in parallel. More...
Inherits MediaWiki\Maintenance\ForkController.
Public Member Functions | |
__construct (string $phpUnitConfigFile, array $groups, array $excludeGroups, ?Event $event, ?SplitGroupExecutor $splitGroupExecutor=null, ?ComposerSystemInterface $composerSystemInterface=null) | |
start () | |
Start the child processes.This should only be called from the command line. It should be called as early as possible during execution.This will return 'child' in the child processes. In the parent process, it will run until all the child processes exit or a TERM signal is received. It will then return 'done'.
| |
![]() | |
__construct ( $numProcs, $flags=0) | |
allSuccessful () | |
Return true if all completed child processes exited with an exit status / return code of 0. | |
getChildNumber () | |
Get the number of the child currently running. | |
Static Public Member Functions | |
static | getDatabaseExcludeGroups () |
static | getDatabaselessExcludeGroups () |
static | getSplitGroupCount () |
Get a split group count, either from the default defined on this class, or from PHPUNIT_PARALLEL_GROUP_COUNT in the environment. | |
static | launchTests (Event $event, array $groups, array $excludeGroups) |
static | launchTestsCustomGroups (Event $event) |
static | launchTestsDatabase (Event $event) |
static | launchTestsDatabaseless (Event $event) |
Public Attributes | |
const | DATABASE_GROUPS = [ 'Database' ] |
const | DATABASELESS_GROUPS = [] |
const | EXIT_STATUS_FAILURE = 1 |
const | EXIT_STATUS_PHPUNIT_LIST_TESTS_ERROR = 2 |
const | EXIT_STATUS_SUCCESS = 0 |
Protected Member Functions | |
prepareEnvironment () | |
![]() | |
forkWorkers ( $numProcs) | |
Fork a number of worker processes. | |
handleTermSignal (int $signal) | |
initChild () | |
Additional Inherited Members | |
![]() | |
int | $childNumber = 0 |
array null | $children = [] |
int[] | $exitStatuses = [] |
int | $flags = 0 |
int | $procsToStart = 0 |
bool | $termReceived = false |
![]() | |
static int[] | $RESTARTABLE_SIGNALS = [] |
Launch PHPUnit test suites in parallel.
This class is run directly from composer.json, outside of any MediaWiki context; consequently, most MediaWiki code cannot be used here. We extend ForkController because it's convenient to do so and ForkController still works here, but we cannot use e.g. Shell::command() to run the composer sub-commands, nor anything else that requires MediaWiki services or config. (But we can use the underlying Shellbox library directly.)
Definition at line 34 of file ComposerLaunchParallel.php.
MediaWiki\Composer\ComposerLaunchParallel::__construct | ( | string | $phpUnitConfigFile, |
array | $groups, | ||
array | $excludeGroups, | ||
?Event | $event, | ||
?SplitGroupExecutor | $splitGroupExecutor = null, | ||
?ComposerSystemInterface | $composerSystemInterface = null ) |
Definition at line 51 of file ComposerLaunchParallel.php.
References MediaWiki\Composer\ComposerLaunchParallel\getSplitGroupCount().
|
static |
Definition at line 209 of file ComposerLaunchParallel.php.
Referenced by MediaWiki\Composer\PhpUnitSplitter\SplitGroupExecutor\runLinearFallback().
|
static |
Definition at line 221 of file ComposerLaunchParallel.php.
Referenced by MediaWiki\Composer\PhpUnitSplitter\SplitGroupExecutor\runLinearFallback().
|
static |
Get a split group count, either from the default defined on this class, or from PHPUNIT_PARALLEL_GROUP_COUNT in the environment.
Throws InvalidSplitGroupCountException for an invalid count.
Definition at line 239 of file ComposerLaunchParallel.php.
Referenced by MediaWiki\Composer\ComposerLaunchParallel\__construct().
|
static |
PhpUnitConsoleOutputProcessingException |
Definition at line 165 of file ComposerLaunchParallel.php.
|
static |
Definition at line 194 of file ComposerLaunchParallel.php.
|
static |
Definition at line 213 of file ComposerLaunchParallel.php.
|
static |
Definition at line 225 of file ComposerLaunchParallel.php.
|
protected |
Reimplemented from MediaWiki\Maintenance\ForkController.
Definition at line 106 of file ComposerLaunchParallel.php.
MediaWiki\Composer\ComposerLaunchParallel::start | ( | ) |
Start the child processes.This should only be called from the command line. It should be called as early as possible during execution.This will return 'child' in the child processes. In the parent process, it will run until all the child processes exit or a TERM signal is received. It will then return 'done'.
Reimplemented from MediaWiki\Maintenance\ForkController.
Definition at line 98 of file ComposerLaunchParallel.php.
const MediaWiki\Composer\ComposerLaunchParallel::DATABASE_GROUPS = [ 'Database' ] |
Definition at line 43 of file ComposerLaunchParallel.php.
Referenced by MediaWiki\Composer\PhpUnitSplitter\SplitGroupExecutor\runLinearFallback().
const MediaWiki\Composer\ComposerLaunchParallel::DATABASELESS_GROUPS = [] |
Definition at line 42 of file ComposerLaunchParallel.php.
Referenced by MediaWiki\Composer\PhpUnitSplitter\SplitGroupExecutor\runLinearFallback().
const MediaWiki\Composer\ComposerLaunchParallel::EXIT_STATUS_FAILURE = 1 |
Definition at line 48 of file ComposerLaunchParallel.php.
const MediaWiki\Composer\ComposerLaunchParallel::EXIT_STATUS_PHPUNIT_LIST_TESTS_ERROR = 2 |
Definition at line 49 of file ComposerLaunchParallel.php.
const MediaWiki\Composer\ComposerLaunchParallel::EXIT_STATUS_SUCCESS = 0 |
Definition at line 47 of file ComposerLaunchParallel.php.