MediaWiki master
MediaWiki\Composer\ComposerLaunchParallel Class Reference

Launch PHPUnit test suites in parallel. More...

Inherits MediaWiki\Maintenance\ForkController.

Collaboration diagram for MediaWiki\Composer\ComposerLaunchParallel:

Public Member Functions

 __construct (array $groups, array $excludeGroups)
 
 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'.
Returns
string

 
- 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 launchTests (Event $event, array $groups, array $excludeGroups)
 
static launchTestsCustomGroups (Event $event)
 
static launchTestsDatabase (Event $event)
 
static launchTestsDatabaseless (Event $event)
 

Protected Member Functions

 prepareEnvironment ()
 
- Protected Member Functions inherited from MediaWiki\Maintenance\ForkController
 forkWorkers ( $numProcs)
 Fork a number of worker processes.
 
 handleTermSignal ( $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 = []
 

Detailed Description

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.)

Note
GPL-2.0-or-later

Definition at line 30 of file ComposerLaunchParallel.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Composer\ComposerLaunchParallel::__construct ( array $groups,
array $excludeGroups )

Definition at line 36 of file ComposerLaunchParallel.php.

Member Function Documentation

◆ launchTests()

static MediaWiki\Composer\ComposerLaunchParallel::launchTests ( Event $event,
array $groups,
array $excludeGroups )
static

Definition at line 130 of file ComposerLaunchParallel.php.

◆ launchTestsCustomGroups()

static MediaWiki\Composer\ComposerLaunchParallel::launchTestsCustomGroups ( Event $event)
static

Definition at line 149 of file ComposerLaunchParallel.php.

◆ launchTestsDatabase()

static MediaWiki\Composer\ComposerLaunchParallel::launchTestsDatabase ( Event $event)
static

Definition at line 164 of file ComposerLaunchParallel.php.

◆ launchTestsDatabaseless()

static MediaWiki\Composer\ComposerLaunchParallel::launchTestsDatabaseless ( Event $event)
static

Definition at line 172 of file ComposerLaunchParallel.php.

◆ prepareEnvironment()

MediaWiki\Composer\ComposerLaunchParallel::prepareEnvironment ( )
protected

Reimplemented from MediaWiki\Maintenance\ForkController.

Definition at line 76 of file ComposerLaunchParallel.php.

◆ start()

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'.

Returns
string

Reimplemented from MediaWiki\Maintenance\ForkController.

Definition at line 68 of file ComposerLaunchParallel.php.


The documentation for this class was generated from the following file: