2014-05-11 10:00:35 +00:00
{
"name" : "mediawiki/core" ,
"description" : "Free software wiki application developed by the Wikimedia Foundation and others" ,
2018-03-22 05:16:59 +00:00
"type" : "mediawiki-core" ,
2021-01-03 22:29:28 +00:00
"keywords" : [
"mediawiki" ,
"wiki"
] ,
2014-05-11 10:00:35 +00:00
"homepage" : "https://www.mediawiki.org/" ,
"authors" : [
{
"name" : "MediaWiki Community" ,
"homepage" : "https://www.mediawiki.org/wiki/Special:Version/Credits"
}
] ,
2018-03-06 01:14:07 +00:00
"license" : "GPL-2.0-or-later" ,
2014-05-11 10:00:35 +00:00
"support" : {
2023-06-03 08:12:11 +00:00
"issues" : "https://phabricator.wikimedia.org/" ,
2021-05-20 20:57:48 +00:00
"irc" : "irc://irc.libera.chat/mediawiki" ,
2014-05-11 10:00:35 +00:00
"wiki" : "https://www.mediawiki.org/"
} ,
2020-02-13 17:03:07 +00:00
"prefer-stable" : true ,
2014-05-11 10:00:35 +00:00
"require" : {
2024-08-11 11:12:00 +00:00
"composer/semver" : "3.4.2" ,
2024-08-06 20:52:11 +00:00
"cssjanus/cssjanus" : "2.3.0" ,
2022-02-25 12:41:42 +00:00
"ext-calendar" : "*" ,
2016-04-06 23:30:41 +00:00
"ext-ctype" : "*" ,
2019-07-30 20:17:16 +00:00
"ext-dom" : "*" ,
2018-09-24 08:25:53 +00:00
"ext-fileinfo" : "*" ,
2015-02-23 15:03:24 +00:00
"ext-iconv" : "*" ,
2020-11-10 17:53:48 +00:00
"ext-intl" : "*" ,
2016-04-06 23:30:41 +00:00
"ext-json" : "*" ,
2020-12-27 16:04:42 +00:00
"ext-libxml" : "*" ,
2016-01-29 19:42:44 +00:00
"ext-mbstring" : "*" ,
2024-05-05 08:56:08 +00:00
"ext-openssl" : "*" ,
2016-04-06 23:30:41 +00:00
"ext-xml" : "*" ,
2020-12-27 16:04:42 +00:00
"ext-xmlreader" : "*" ,
2024-05-03 13:41:59 +00:00
"guzzlehttp/guzzle" : "7.8.1" ,
2023-10-01 14:39:33 +00:00
"justinrainbow/json-schema" : "5.2.13" ,
2015-11-23 00:37:33 +00:00
"liuggio/statsd-php-client" : "1.0.18" ,
2024-03-05 21:05:23 +00:00
"mck89/peast" : "1.16.2" ,
2024-05-03 19:55:00 +00:00
"monolog/monolog" : "2.9.3" ,
2024-07-12 00:32:45 +00:00
"oojs/oojs-ui" : "0.50.4" ,
2023-12-21 20:22:28 +00:00
"pear/mail" : "1.6.0" ,
2024-04-05 20:23:35 +00:00
"pear/mail_mime" : "1.10.12" ,
2024-05-03 13:51:19 +00:00
"pear/net_smtp" : "1.12.1" ,
2020-08-11 11:06:46 +00:00
"php" : ">=7.4.3" ,
2023-01-15 15:52:53 +00:00
"psr/container" : "1.1.2" ,
2023-12-21 22:04:52 +00:00
"psr/http-message" : "1.1" ,
2021-10-08 19:36:55 +00:00
"psr/log" : "1.1.4" ,
2020-03-18 08:49:15 +00:00
"ralouphie/getallheaders" : "3.0.3" ,
2024-04-05 20:22:20 +00:00
"symfony/polyfill-php80" : "1.29.0" ,
"symfony/polyfill-php81" : "1.29.0" ,
"symfony/polyfill-php82" : "1.29.0" ,
"symfony/polyfill-php83" : "1.29.0" ,
2024-05-03 20:02:21 +00:00
"symfony/yaml" : "5.4.39" ,
2021-12-21 12:11:36 +00:00
"wikimedia/assert" : "0.5.1" ,
2021-03-21 21:43:42 +00:00
"wikimedia/at-ease" : "2.1.0" ,
2022-07-08 22:31:49 +00:00
"wikimedia/base-convert" : "2.0.2" ,
2023-10-03 15:48:52 +00:00
"wikimedia/bcp-47-code" : "2.0.0" ,
2023-07-24 14:58:57 +00:00
"wikimedia/cdb" : "3.0.0" ,
2021-02-12 01:01:34 +00:00
"wikimedia/cldr-plural-rule-parser" : "2.0.0" ,
2023-06-06 12:44:40 +00:00
"wikimedia/common-passwords" : "0.5.0" ,
2023-04-24 13:37:55 +00:00
"wikimedia/composer-merge-plugin" : "2.1.0" ,
2024-03-13 18:00:36 +00:00
"wikimedia/html-formatter" : "4.1.0" ,
2023-10-02 23:12:04 +00:00
"wikimedia/ip-utils" : "5.0.0" ,
2024-07-22 20:03:17 +00:00
"wikimedia/json-codec" : "3.0.2" ,
2024-08-07 15:19:45 +00:00
"wikimedia/less.php" : "5.1.1" ,
2023-11-15 16:26:12 +00:00
"wikimedia/minify" : "2.7.0" ,
2021-07-02 21:05:23 +00:00
"wikimedia/normalized-exception" : "1.0.1" ,
2023-01-09 22:16:46 +00:00
"wikimedia/object-factory" : "5.0.1" ,
2024-08-19 13:49:22 +00:00
"wikimedia/parsoid" : "0.20.0-a17" ,
2022-07-08 22:35:30 +00:00
"wikimedia/php-session-serializer" : "2.0.1" ,
2021-09-14 19:36:56 +00:00
"wikimedia/purtle" : "1.0.8" ,
2023-12-21 20:32:19 +00:00
"wikimedia/relpath" : "4.0.0" ,
2024-03-16 16:11:51 +00:00
"wikimedia/remex-html" : "4.1.0" ,
2022-02-10 07:54:19 +00:00
"wikimedia/request-timeout" : "1.2.0" ,
2022-07-29 04:51:26 +00:00
"wikimedia/running-stat" : "2.1.0" ,
2022-07-24 16:28:00 +00:00
"wikimedia/scoped-callback" : "4.0.0" ,
"wikimedia/services" : "3.0.0" ,
2024-03-05 17:04:05 +00:00
"wikimedia/shellbox" : "4.0.2" ,
2023-08-29 16:02:36 +00:00
"wikimedia/utfnormal" : "4.0.0" ,
2023-09-29 19:05:16 +00:00
"wikimedia/timestamp" : "4.1.1" ,
2021-08-23 21:21:18 +00:00
"wikimedia/wait-condition-loop" : "2.0.2" ,
2021-10-08 23:07:35 +00:00
"wikimedia/wrappedstring" : "4.0.1" ,
2022-12-16 15:13:48 +00:00
"wikimedia/xmp-reader" : "0.9.1" ,
2021-10-08 22:59:23 +00:00
"zordius/lightncandy" : "1.2.6"
2014-05-11 10:00:35 +00:00
} ,
"require-dev" : {
2023-12-22 02:57:16 +00:00
"composer/spdx-licenses" : "1.5.8" ,
2024-05-03 18:21:35 +00:00
"doctrine/dbal" : "3.8.4" ,
2023-12-22 02:58:37 +00:00
"doctrine/sql-formatter" : "1.1.3" ,
2022-10-26 00:25:19 +00:00
"ext-simplexml" : "*" ,
2023-11-20 13:56:31 +00:00
"giorgiosironi/eris" : "^0.14.0" ,
2017-04-19 19:37:35 +00:00
"hamcrest/hamcrest-php" : "^2.0" ,
2022-01-24 04:22:04 +00:00
"johnkary/phpunit-speedtrap" : "^4.0" ,
2024-08-11 11:08:16 +00:00
"mediawiki/mediawiki-codesniffer" : "44.0.0" ,
2024-02-08 23:12:50 +00:00
"mediawiki/mediawiki-phan-config" : "0.14.0" ,
2024-05-04 17:50:57 +00:00
"mediawiki/minus-x" : "1.1.3" ,
2021-10-08 19:21:38 +00:00
"nikic/php-parser" : "^4.10.2" ,
2022-10-07 17:35:34 +00:00
"php-parallel-lint/php-console-highlighter" : "1.0.0" ,
2024-03-29 02:55:30 +00:00
"php-parallel-lint/php-parallel-lint" : "1.4.0" ,
2024-05-03 19:56:51 +00:00
"phpunit/phpunit" : "9.6.19" ,
2024-04-06 08:15:58 +00:00
"psy/psysh" : "^0.12.3" ,
2024-05-03 13:58:40 +00:00
"seld/jsonlint" : "1.10.2" ,
2023-03-10 18:27:41 +00:00
"wikimedia/alea" : "1.0.0" ,
2022-09-21 08:36:36 +00:00
"wikimedia/langconv" : "^0.4.2" ,
2023-12-05 18:19:41 +00:00
"wikimedia/testing-access-wrapper" : "^3.0.0" ,
2021-04-20 12:41:37 +00:00
"wmde/hamcrest-html-matchers" : "^1.0.0"
2014-05-11 10:00:35 +00:00
} ,
2019-01-21 22:22:31 +00:00
"replace" : {
"symfony/polyfill-ctype" : "1.99" ,
2024-01-25 19:55:11 +00:00
"symfony/polyfill-intl-grapheme" : "1.17.1" ,
"symfony/polyfill-intl-normalizer" : "1.17.1" ,
2019-01-21 22:22:31 +00:00
"symfony/polyfill-mbstring" : "1.99"
} ,
2014-05-11 10:00:35 +00:00
"suggest" : {
2022-03-06 00:45:43 +00:00
"ext-apcu" : "Faster web responses overall." ,
2024-01-13 16:42:00 +00:00
"ext-bcmath" : "Increased performance of some operations. Required especially on 32 bit machines. This or ext-gmp are needed for scrambling Temporary Accounts." ,
2022-03-06 00:45:43 +00:00
"ext-curl" : "Faster HTTP services, e.g. when using InstantCommons, Swift, or Etcd." ,
2023-01-24 22:14:20 +00:00
"ext-exif" : "Enable processing of EXIF information in file uploads." ,
2022-03-06 00:45:43 +00:00
"ext-gd" : "Enable thumbnails for file uploads." ,
2024-01-13 16:42:00 +00:00
"ext-gmp" : "Increased performance of some operations. Required especially on 32 bit machines. This or ext-bcmath are needed for scrambling Temporary Accounts." ,
2024-07-31 15:51:08 +00:00
"ext-igbinary" : "Enables use of igbinary for serialisation." ,
"ext-imagick" : "Enables use of imagemagick for image manipulation." ,
"ext-memcached" : "Enables use of Memcached for caching purposes." ,
2022-03-06 00:45:43 +00:00
"ext-mysqli" : "Enable the MySQL and MariaDB database type for MediaWiki." ,
"ext-pdo" : "Enable the SQLite database type for MediaWiki." ,
"ext-pgsql" : "Enable the PostgreSQL database type for MediaWiki." ,
"ext-posix" : "Enable CLI concurrent processing, e.g. for runJobs.php." ,
"ext-pcntl" : "Enable CLI concurrent processing, e.g. for runJobs.php and rebuildLocalisationCache.php." ,
"ext-readline" : "Enable CLI history and autocomplete, e.g. for eval.php and other REPLs." ,
2024-07-31 15:51:08 +00:00
"ext-redis" : "Enables use of Redis for caching purposes." ,
2022-03-06 00:45:43 +00:00
"ext-sockets" : "Enable CLI concurrent processing, e.g. for rebuildLocalisationCache.php." ,
"ext-wikidiff2" : "Faster text difference engine." ,
2024-07-31 15:51:08 +00:00
"ext-wincache" : "Enables use of WinCache on Windows." ,
2022-03-06 00:45:43 +00:00
"ext-zlib" : "Enable use of GZIP compression, e.g. for SqlBagOStuff (ParserCache), $wgCompressRevisions, or $wgUseFileCache." ,
2022-03-25 00:06:08 +00:00
"monolog/monolog" : "Enable use of MonologSpi ($wgMWLoggerDefaultSpi)."
2014-09-23 19:31:30 +00:00
} ,
"autoload" : {
2024-01-13 17:06:28 +00:00
"psr-4" : {
"MediaWiki\\Composer\\" : "includes/composer"
2018-05-25 12:08:24 +00:00
}
2014-09-23 19:31:30 +00:00
} ,
2017-02-03 15:09:14 +00:00
"autoload-dev" : {
"files" : [
"vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php" ,
"vendor/wmde/hamcrest-html-matchers/src/functions.php"
]
} ,
2014-09-23 19:31:30 +00:00
"scripts" : {
2023-12-23 21:05:42 +00:00
"mw-install:sqlite" : "@php maintenance/run.php install --server=http://localhost:4000 --dbtype sqlite --with-developmentsettings --dbpath cache/ --scriptpath= --pass adminpassword MediaWiki Admin" ,
2023-11-24 07:39:37 +00:00
"serve" : [
"Composer\\Config::disableProcessTimeout" ,
2023-11-29 09:01:22 +00:00
"@putenv MW_LOG_DIR=logs" ,
2023-12-21 08:16:12 +00:00
"@putenv MW_LOG_STDERR=1" ,
build: Set PHP_CLI_SERVER_WORKERS=8 in composer serve
* This way page views and most common user interacts don't involve
queued requests by default.
* Devtools waterfall charts show realistic latency numbers, instead of
making it seem that serving a .jpg is slower than a PHP request,
because it happens to be queued behind one, when there are only
3 requests at the same time.
* Profilers become more comparable between quickstart, docker,
vagrant, beta, and production.
* Allow benchmarking with 'ab' out of the box, with at least some
concurrency, and in a way that the concurrency is obvious and easy
to find (the user ran 'composer serve' and can see WORKERS= setting
in the CLI output, as well as in composer.json).
* Slightly faster page views, especially interactions like loading
VisualEditor where there are 2-3 concurrent API requests.
https://www.mediawiki.org/w/index.php?title=Talk%3ALocal_development_quickstart&oldid=6271780#Multiple_workers_for_PHP_server
== Why 8 ==
I believe most CPUs used by contributer's devices have at least 8 cores
these days. However, even if they have a 2-core or 4-core machine,
I'd much rather requests be handled concurrently by the OS, than
forcefully queued in their entirety.
Most latency in web apps tends to be blocked on I/O (file, network,
database), so there's plenty of oppertunity for CPU sharing. Even in
WMF production, we spawn 2x the php-fpm threads as we have CPUs
(fpm_workers_multiplier).
We could comfortably set this to 16 or 32 as well, but given this is
a local server for a single-user, you're realistically not going to
actually be able to (naturally) cause more concurrency, short of
benchmarking. 8 seems about right as being just above what is normal
on a typical pageview, yet short of potential arguments about how
much and whether to induce CPU sharing for most people.
Bug: T347347
Change-Id: I7d6fbe02e13375d4e95c12165c29469cd0946d34
2023-12-19 16:00:46 +00:00
"@putenv PHP_CLI_SERVER_WORKERS=8" ,
2023-12-23 21:05:42 +00:00
"@php -S 127.0.0.1:4000"
2023-11-24 07:39:37 +00:00
] ,
2022-01-24 22:38:59 +00:00
"lint" : "parallel-lint --exclude node_modules --exclude vendor" ,
2020-12-23 16:44:17 +00:00
"phan" : "phan -d . --long-progress-bar" ,
2021-07-06 11:26:55 +00:00
"phpcs" : "phpcs -p -s --cache" ,
2021-01-03 22:29:28 +00:00
"fix" : [
2024-05-04 17:50:57 +00:00
"phpcbf" ,
"minus-x fix ."
2021-01-03 22:29:28 +00:00
] ,
2024-01-13 17:00:37 +00:00
"pre-install-cmd" : "MediaWiki\\Composer\\VersionChecker::onEvent" ,
"pre-update-cmd" : "MediaWiki\\Composer\\VersionChecker::onEvent" ,
2024-01-13 17:06:28 +00:00
"post-install-cmd" : "MediaWiki\\Composer\\ComposerVendorHtaccessCreator::onEvent" ,
"post-update-cmd" : "MediaWiki\\Composer\\ComposerVendorHtaccessCreator::onEvent" ,
2023-07-13 15:31:49 +00:00
"releasenotes" : "@phpunit --group ReleaseNotes" ,
2015-01-06 18:47:25 +00:00
"test" : [
2021-11-24 16:40:04 +00:00
"@lint ." ,
2024-05-04 17:50:57 +00:00
"@phpcs ." ,
"minus-x check ."
2019-06-26 02:33:14 +00:00
] ,
2021-02-13 02:22:47 +00:00
"test-some" : [
2021-11-24 16:40:04 +00:00
"@lint" ,
"@phpcs"
2021-02-13 02:22:47 +00:00
] ,
2023-07-02 17:14:27 +00:00
"phpunit" : "phpunit" ,
"phpunit:unit" : "@phpunit --colors=always --testsuite=core:unit,extensions:unit,skins:unit" ,
2022-06-07 10:53:59 +00:00
"phpunit:integration" : "@phpunit --colors=always --testsuite=core:integration,extensions:integration,skins:integration" ,
"phpunit:coverage" : "@phpunit --testsuite=core:unit --exclude-group Dump,Broken" ,
2024-05-04 12:48:43 +00:00
"phpunit:coverage-edit" : "MediaWiki\\Composer\\ComposerPhpunitXmlCoverageEdit::onEvent" ,
2024-04-24 13:26:38 +00:00
"phpunit:entrypoint" : "@phpunit" ,
Add `phpunit:prepare-parallel:extensions` command
In T361190 and Quibble 1.9.0, we introduced parallel execution of
PHPUnit tests to speed up the CI jobs. The existing implementation
is purely Python/Quibble, and cannot directly be used by developers
locally. With this patch, we re-implement the test splitting logic
already implemented in CI as a composer task so that the parallel
tests can be run locally.
There are a couple of different approaches to running PHPUnit tests
in parallel. The different approaches have been discussed at length
in T50217. Ideally, we would just install the `paratest` extension
and use that to parallelise the execution. Unfortunately we have
complex test suites (specifically Parser tests and the Scribunto
test suite) that dynamically create tests as they run, which makes
it hard for `paratest` to work out which tests will run.
To overcome this limitation, we use the `phpunit --list-tests`
function to create a list of test classes that would be included in
the execution of the test suite, then scan the filesystem for
classes named in the `tests-list.xml` output. The classes we find
are then collected into smaller groups (`split_group_X`) which we
can run in parallel in separate processes.
We split into 7-8 groups here, as that experimentally leads to an
even spread of the tests and consumes 100% of all cores on a 4-core
processor.
Because `ParserIntegrationTest.php` is a single test class that
generates thousands of integration tests, we put that in its own
bucket rather than allocating it round-robin to one of the split
buckets. This again helps to keep the buckets roughly the same size.
The current implementation only supports splitting the `extensions`
test suite. We need to do some more development and testing to
support splitting other suites.
The new composer command `phpunit:prepare-parallel:extensions` will
generate a `phpunit.xml` file with the same contents as
`phpunit.xml.dist`, but with the split-group suites added. The
result of running all of the split groups should be the same as the
result of running the whole test suite.
Bug: T365976
Change-Id: I2d841ab236c5367961603bb526319053551bec2e
2024-05-31 12:44:45 +00:00
"phpunit:prepare-parallel:extensions" : [
"MediaWiki\\Composer\\PhpUnitSplitter\\PhpUnitXmlManager::listTestsNotice" ,
Add `phpunit:parallel:extensions` composer command
In T361190 and Quibble 1.9.0, we introduced parallel execution of
PHPUnit tests to speed up the CI jobs. The existing implementation
is purely Python/Quibble, and cannot directly be used by developers
locally. With this patch, we re-implement the parallel test
execution already implemented in CI as a composer task so that the
parallel tests can be run locally.
The `phpunit:parallel:extensions` command expects to be run after
`phpunit:prepare-parallel:extensions`, and expects to find 8 test
suites with the names `split_group_X` (for X in 0 through 7) in the
PHPUnit configuration file. 8 here is currently a hard-coded number
that corresponds to the number of parallel test executions we need
to saturate the CPU of a 4-core developer machine, and experimentally
leads to a good speed-up versus the serial execution.
When this command runs, it forks to launch 8 parallel processes,
each running one of the `split_group_X` suites. The parent process
waits for the children to complete, buffers the output, collects the
exit statuses, then dumps the buffered output and exits with a
non-zero status if any of the child processes failed (i.e. if there
were test failures).
We introduce `phpunit:prepare-parallel:default` as a complement to
`phpunit:prepare-parallel:extensions`, and the two commands
`phpunit:parallel:database` and `phpunit:parallel:databaseless`.
This creates four possible combinations - two different test suites,
and two different test groups. This is a similar setup to that which
we have in CI - the Database and non-Database tests are run in
separate groups, and some jobs use the `extensions` suite while
others just use the default suite.
The `phpunit:parallel:...` commands will fail with a helpful message
if no `split_group_`s are found in the active PHPUnit configuration.
To help test whether the split test runs are really running all the
tests in the suite, we generate and store the PHPUnit results cache
file. Comparing the results cache files from linear versus parallel
runs should tell us if all the tests have been executed.
Bug: T365976
Change-Id: If106802f08edd5d4c841bb7970c69b88ab3bb39b
2024-06-04 06:38:55 +00:00
"@phpunit --list-tests-xml=tests-list-extensions.xml --testsuite=extensions" ,
"MediaWiki\\Composer\\PhpUnitSplitter\\PhpUnitXmlManager::splitTestsListExtensions"
] ,
"phpunit:prepare-parallel:default" : [
"MediaWiki\\Composer\\PhpUnitSplitter\\PhpUnitXmlManager::listTestsNotice" ,
"@phpunit --list-tests-xml=tests-list-default.xml" ,
"MediaWiki\\Composer\\PhpUnitSplitter\\PhpUnitXmlManager::splitTestsListDefault"
Add `phpunit:prepare-parallel:extensions` command
In T361190 and Quibble 1.9.0, we introduced parallel execution of
PHPUnit tests to speed up the CI jobs. The existing implementation
is purely Python/Quibble, and cannot directly be used by developers
locally. With this patch, we re-implement the test splitting logic
already implemented in CI as a composer task so that the parallel
tests can be run locally.
There are a couple of different approaches to running PHPUnit tests
in parallel. The different approaches have been discussed at length
in T50217. Ideally, we would just install the `paratest` extension
and use that to parallelise the execution. Unfortunately we have
complex test suites (specifically Parser tests and the Scribunto
test suite) that dynamically create tests as they run, which makes
it hard for `paratest` to work out which tests will run.
To overcome this limitation, we use the `phpunit --list-tests`
function to create a list of test classes that would be included in
the execution of the test suite, then scan the filesystem for
classes named in the `tests-list.xml` output. The classes we find
are then collected into smaller groups (`split_group_X`) which we
can run in parallel in separate processes.
We split into 7-8 groups here, as that experimentally leads to an
even spread of the tests and consumes 100% of all cores on a 4-core
processor.
Because `ParserIntegrationTest.php` is a single test class that
generates thousands of integration tests, we put that in its own
bucket rather than allocating it round-robin to one of the split
buckets. This again helps to keep the buckets roughly the same size.
The current implementation only supports splitting the `extensions`
test suite. We need to do some more development and testing to
support splitting other suites.
The new composer command `phpunit:prepare-parallel:extensions` will
generate a `phpunit.xml` file with the same contents as
`phpunit.xml.dist`, but with the split-group suites added. The
result of running all of the split groups should be the same as the
result of running the whole test suite.
Bug: T365976
Change-Id: I2d841ab236c5367961603bb526319053551bec2e
2024-05-31 12:44:45 +00:00
] ,
"phpunit:prepare-parallel:split-file" : "MediaWiki\\Composer\\PhpUnitSplitter\\PhpUnitXmlManager::splitTestsCustom" ,
Add `phpunit:parallel:extensions` composer command
In T361190 and Quibble 1.9.0, we introduced parallel execution of
PHPUnit tests to speed up the CI jobs. The existing implementation
is purely Python/Quibble, and cannot directly be used by developers
locally. With this patch, we re-implement the parallel test
execution already implemented in CI as a composer task so that the
parallel tests can be run locally.
The `phpunit:parallel:extensions` command expects to be run after
`phpunit:prepare-parallel:extensions`, and expects to find 8 test
suites with the names `split_group_X` (for X in 0 through 7) in the
PHPUnit configuration file. 8 here is currently a hard-coded number
that corresponds to the number of parallel test executions we need
to saturate the CPU of a 4-core developer machine, and experimentally
leads to a good speed-up versus the serial execution.
When this command runs, it forks to launch 8 parallel processes,
each running one of the `split_group_X` suites. The parent process
waits for the children to complete, buffers the output, collects the
exit statuses, then dumps the buffered output and exits with a
non-zero status if any of the child processes failed (i.e. if there
were test failures).
We introduce `phpunit:prepare-parallel:default` as a complement to
`phpunit:prepare-parallel:extensions`, and the two commands
`phpunit:parallel:database` and `phpunit:parallel:databaseless`.
This creates four possible combinations - two different test suites,
and two different test groups. This is a similar setup to that which
we have in CI - the Database and non-Database tests are run in
separate groups, and some jobs use the `extensions` suite while
others just use the default suite.
The `phpunit:parallel:...` commands will fail with a helpful message
if no `split_group_`s are found in the active PHPUnit configuration.
To help test whether the split test runs are really running all the
tests in the suite, we generate and store the PHPUnit results cache
file. Comparing the results cache files from linear versus parallel
runs should tell us if all the tests have been executed.
Bug: T365976
Change-Id: If106802f08edd5d4c841bb7970c69b88ab3bb39b
2024-06-04 06:38:55 +00:00
"phpunit:parallel:custom-groups" : "MediaWiki\\Composer\\ComposerLaunchParallel::launchTestsCustomGroups" ,
"phpunit:parallel:database" : "MediaWiki\\Composer\\ComposerLaunchParallel::launchTestsDatabase" ,
"phpunit:parallel:databaseless" : "MediaWiki\\Composer\\ComposerLaunchParallel::launchTestsDatabaseless" ,
2024-04-24 13:26:38 +00:00
"maintenance" : "@php maintenance/run.php"
2014-12-02 17:19:18 +00:00
} ,
"config" : {
2015-09-27 05:16:10 +00:00
"optimize-autoloader" : true ,
2021-12-23 23:11:52 +00:00
"prepend-autoloader" : false ,
"allow-plugins" : {
2022-07-12 12:30:17 +00:00
"wikimedia/composer-merge-plugin" : true ,
2023-10-19 23:04:34 +00:00
"composer/installers" : true ,
"dealerdirect/phpcodesniffer-composer-installer" : true
2021-12-23 23:11:52 +00:00
}
2014-12-30 23:42:32 +00:00
} ,
"extra" : {
"merge-plugin" : {
"include" : [
"composer.local.json"
2015-11-06 22:11:35 +00:00
] ,
"merge-dev" : false
2014-12-30 23:42:32 +00:00
}
2014-05-11 10:00:35 +00:00
}
}