|
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, ?string $logDir=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'.
| |
Public Member Functions inherited from MediaWiki\Maintenance\ForkController | |
| __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 () | |
Protected Member Functions inherited from MediaWiki\Maintenance\ForkController | |
| forkWorkers ( $numProcs) | |
| Fork a number of worker processes. | |
| handleTermSignal (int $signal) | |
| initChild () | |
Additional Inherited Members | |
Protected Attributes inherited from MediaWiki\Maintenance\ForkController | |
| int | $childNumber = 0 |
| array null | $children = [] |
| int[] | $exitStatuses = [] |
| int | $flags = 0 |
| int | $procsToStart = 0 |
| bool | $termReceived = false |
Static Protected Attributes inherited from MediaWiki\Maintenance\ForkController | |
| 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 35 of file ComposerLaunchParallel.php.
| MediaWiki\Composer\ComposerLaunchParallel::__construct | ( | string | $phpUnitConfigFile, |
| array | $groups, | ||
| array | $excludeGroups, | ||
| ?Event | $event, | ||
| ?SplitGroupExecutor | $splitGroupExecutor = null, | ||
| ?ComposerSystemInterface | $composerSystemInterface = null, | ||
| ?string | $logDir = null ) |
Definition at line 53 of file ComposerLaunchParallel.php.
References $logDir, and MediaWiki\Composer\ComposerLaunchParallel\getSplitGroupCount().
|
static |
Definition at line 261 of file ComposerLaunchParallel.php.
Referenced by MediaWiki\Composer\PhpUnitSplitter\SplitGroupExecutor\runLinearFallback().
|
static |
Definition at line 273 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 291 of file ComposerLaunchParallel.php.
Referenced by MediaWiki\Composer\ComposerLaunchParallel\__construct().
|
static |
| PhpUnitConsoleOutputProcessingException |
Definition at line 217 of file ComposerLaunchParallel.php.
|
static |
Definition at line 246 of file ComposerLaunchParallel.php.
|
static |
Definition at line 265 of file ComposerLaunchParallel.php.
|
static |
Definition at line 277 of file ComposerLaunchParallel.php.
|
protected |
Reimplemented from MediaWiki\Maintenance\ForkController.
Definition at line 159 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'.
| LockingException |
Reimplemented from MediaWiki\Maintenance\ForkController.
Definition at line 108 of file ComposerLaunchParallel.php.
| const MediaWiki\Composer\ComposerLaunchParallel::DATABASE_GROUPS = [ 'Database' ] |
Definition at line 45 of file ComposerLaunchParallel.php.
Referenced by MediaWiki\Composer\PhpUnitSplitter\SplitGroupExecutor\runLinearFallback().
| const MediaWiki\Composer\ComposerLaunchParallel::DATABASELESS_GROUPS = [] |
Definition at line 44 of file ComposerLaunchParallel.php.
Referenced by MediaWiki\Composer\PhpUnitSplitter\SplitGroupExecutor\runLinearFallback().
| const MediaWiki\Composer\ComposerLaunchParallel::EXIT_STATUS_FAILURE = 1 |
Definition at line 50 of file ComposerLaunchParallel.php.
| const MediaWiki\Composer\ComposerLaunchParallel::EXIT_STATUS_PHPUNIT_LIST_TESTS_ERROR = 2 |
Definition at line 51 of file ComposerLaunchParallel.php.
| const MediaWiki\Composer\ComposerLaunchParallel::EXIT_STATUS_SUCCESS = 0 |
Definition at line 49 of file ComposerLaunchParallel.php.