2019-06-26 02:33:14 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2022-06-09 14:15:54 +00:00
|
|
|
<phpunit bootstrap="tests/phpunit/bootstrap.php"
|
2019-06-26 02:33:14 +00:00
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
2021-03-25 10:38:39 +00:00
|
|
|
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
|
2019-06-26 02:33:14 +00:00
|
|
|
colors="true"
|
|
|
|
|
backupGlobals="false"
|
2021-09-25 09:57:23 +00:00
|
|
|
convertDeprecationsToExceptions="true"
|
2019-06-26 02:33:14 +00:00
|
|
|
convertErrorsToExceptions="true"
|
|
|
|
|
convertNoticesToExceptions="true"
|
|
|
|
|
convertWarningsToExceptions="true"
|
|
|
|
|
forceCoversAnnotation="true"
|
2020-04-05 12:25:03 +00:00
|
|
|
failOnWarning="true"
|
2019-06-26 02:33:14 +00:00
|
|
|
stopOnFailure="false"
|
2023-07-13 15:37:30 +00:00
|
|
|
failOnRisky="true"
|
2019-06-26 02:33:14 +00:00
|
|
|
beStrictAboutTestsThatDoNotTestAnything="true"
|
|
|
|
|
beStrictAboutOutputDuringTests="true"
|
2023-07-13 15:37:30 +00:00
|
|
|
verbose="false"
|
2022-05-30 19:27:10 +00:00
|
|
|
printerClass="MediaWikiPHPUnitResultPrinter"
|
2023-07-13 15:37:30 +00:00
|
|
|
stderr="true">
|
|
|
|
|
<!-- Output only to stderr to avoid "Headers already sent" problems -->
|
2019-06-26 02:33:14 +00:00
|
|
|
<php>
|
2022-07-12 08:32:32 +00:00
|
|
|
<ini name="memory_limit" value="-1" />
|
|
|
|
|
<ini name="max_execution_time" value="0" />
|
2019-06-26 02:33:14 +00:00
|
|
|
</php>
|
|
|
|
|
<testsuites>
|
2019-07-05 15:33:08 +00:00
|
|
|
<testsuite name="core:unit">
|
2019-06-26 02:33:14 +00:00
|
|
|
<directory>tests/phpunit/unit</directory>
|
|
|
|
|
</testsuite>
|
2019-07-05 15:33:08 +00:00
|
|
|
<testsuite name="extensions:unit">
|
phpunit: Determine what extensions to load in unit tests via config
When running unit tests, the bootstrap would previously load all
extensions and skins in the filesystem. This was OK for an initial
implementation, but is not acceptable if we want to eventually do that
for all PHPUnit entry points (once we'll have a single config and
bootstrap). Instead, it's desirable to only load the extensions
specified in LocalSettings.php. The problem is that it's pretty much
impossible to load LocalSettings.php without also loading the rest of
MediaWiki, with all the side effects this might have.
This patch introduces a helper script that loads all the config, then
prints what extensions and skins were loaded. The bootstrap file runs
this script via proc_open and then reads the list of extensions to
load. Because the script is run in a separate process, any side effects
only affect the spawned process, not the one where PHPUnit is running.
Currently, there doesn't seem to be a better way to obtain the list of
extensions loaded in LocalSettings.php without all the other side
effects. YAML settings
(https://www.mediawiki.org/wiki/Manual:YAML_settings_file_format) would
probably help, but that's very far from becoming the only supported
config format (if it will ever be).
Also add two TestSuite implementations to replace the '*' wildcard in the
extensions:unit and skins:unit suites. These use the same list of loaded
extensions to determine where to look for tests.
And last but not least: my most sincere apologies to you if the hack
you're seeing here has ruined your day. If you think a better approach
exists, please tell me and I'll be so relieved!
Bug: T227900
Change-Id: Ib578644b8a4c0b64dca607afb9eb8204ca7fc660
2023-07-13 00:57:20 +00:00
|
|
|
<file>tests/phpunit/suites/ExtensionsUnitTestSuite.php</file>
|
2019-07-05 15:33:08 +00:00
|
|
|
</testsuite>
|
|
|
|
|
<testsuite name="skins:unit">
|
phpunit: Determine what extensions to load in unit tests via config
When running unit tests, the bootstrap would previously load all
extensions and skins in the filesystem. This was OK for an initial
implementation, but is not acceptable if we want to eventually do that
for all PHPUnit entry points (once we'll have a single config and
bootstrap). Instead, it's desirable to only load the extensions
specified in LocalSettings.php. The problem is that it's pretty much
impossible to load LocalSettings.php without also loading the rest of
MediaWiki, with all the side effects this might have.
This patch introduces a helper script that loads all the config, then
prints what extensions and skins were loaded. The bootstrap file runs
this script via proc_open and then reads the list of extensions to
load. Because the script is run in a separate process, any side effects
only affect the spawned process, not the one where PHPUnit is running.
Currently, there doesn't seem to be a better way to obtain the list of
extensions loaded in LocalSettings.php without all the other side
effects. YAML settings
(https://www.mediawiki.org/wiki/Manual:YAML_settings_file_format) would
probably help, but that's very far from becoming the only supported
config format (if it will ever be).
Also add two TestSuite implementations to replace the '*' wildcard in the
extensions:unit and skins:unit suites. These use the same list of loaded
extensions to determine where to look for tests.
And last but not least: my most sincere apologies to you if the hack
you're seeing here has ruined your day. If you think a better approach
exists, please tell me and I'll be so relieved!
Bug: T227900
Change-Id: Ib578644b8a4c0b64dca607afb9eb8204ca7fc660
2023-07-13 00:57:20 +00:00
|
|
|
<file>tests/phpunit/suites/SkinsUnitTestSuite.php</file>
|
2019-07-05 15:33:08 +00:00
|
|
|
</testsuite>
|
2021-12-08 14:42:59 +00:00
|
|
|
<testsuite name="includes">
|
|
|
|
|
<directory>tests/phpunit/includes</directory>
|
|
|
|
|
</testsuite>
|
|
|
|
|
<testsuite name="parsertests">
|
|
|
|
|
<file>tests/phpunit/suites/CoreParserTestSuite.php</file>
|
|
|
|
|
<file>tests/phpunit/suites/ExtensionsParserTestSuite.php</file>
|
|
|
|
|
</testsuite>
|
|
|
|
|
<testsuite name="skins">
|
|
|
|
|
<directory>tests/phpunit/structure</directory>
|
|
|
|
|
<file>tests/phpunit/suites/ExtensionsTestSuite.php</file>
|
|
|
|
|
</testsuite>
|
|
|
|
|
<!-- As there is a class Maintenance, we cannot use the name "maintenance" directly -->
|
|
|
|
|
<testsuite name="maintenance_suite">
|
|
|
|
|
<directory>tests/phpunit/maintenance</directory>
|
2019-07-05 15:33:08 +00:00
|
|
|
</testsuite>
|
2021-12-08 14:42:59 +00:00
|
|
|
<testsuite name="structure">
|
|
|
|
|
<directory>tests/phpunit/structure</directory>
|
2019-07-05 15:33:08 +00:00
|
|
|
</testsuite>
|
2021-12-08 14:42:59 +00:00
|
|
|
<testsuite name="tests">
|
|
|
|
|
<directory>tests/phpunit/tests</directory>
|
|
|
|
|
</testsuite>
|
|
|
|
|
<testsuite name="extensions">
|
|
|
|
|
<directory>tests/phpunit/structure</directory>
|
|
|
|
|
<file>tests/phpunit/suites/ExtensionsTestSuite.php</file>
|
|
|
|
|
<file>tests/phpunit/suites/ExtensionsParserTestSuite.php</file>
|
|
|
|
|
</testsuite>
|
|
|
|
|
<testsuite name="integration">
|
|
|
|
|
<directory>tests/phpunit/integration</directory>
|
2019-06-26 02:33:14 +00:00
|
|
|
</testsuite>
|
2023-08-01 12:47:09 +00:00
|
|
|
<testsuite name="docs">
|
|
|
|
|
<directory>tests/phpunit/docs</directory>
|
|
|
|
|
</testsuite>
|
2019-06-26 02:33:14 +00:00
|
|
|
</testsuites>
|
|
|
|
|
<groups>
|
|
|
|
|
<exclude>
|
|
|
|
|
<group>Broken</group>
|
|
|
|
|
</exclude>
|
|
|
|
|
</groups>
|
2021-03-25 10:38:39 +00:00
|
|
|
<coverage includeUncoveredFiles="false">
|
|
|
|
|
<include>
|
2019-06-26 02:33:14 +00:00
|
|
|
<directory suffix=".php">includes</directory>
|
|
|
|
|
<directory suffix=".php">languages</directory>
|
|
|
|
|
<directory suffix=".php">maintenance</directory>
|
2019-07-03 14:48:55 +00:00
|
|
|
<directory suffix=".php">extensions</directory>
|
|
|
|
|
<directory suffix=".php">skins</directory>
|
2021-03-25 10:38:39 +00:00
|
|
|
</include>
|
|
|
|
|
<exclude>
|
|
|
|
|
<directory suffix=".php">languages/messages</directory>
|
|
|
|
|
<directory suffix=".php">maintenance/benchmarks</directory>
|
|
|
|
|
<directory suffix=".php">extensions/*/tests</directory>
|
|
|
|
|
<directory suffix=".php">skins/*/tests</directory>
|
|
|
|
|
</exclude>
|
|
|
|
|
</coverage>
|
2019-06-26 02:33:14 +00:00
|
|
|
<listeners>
|
|
|
|
|
<listener class="JohnKary\PHPUnit\Listener\SpeedTrapListener">
|
|
|
|
|
<arguments>
|
|
|
|
|
<array>
|
|
|
|
|
<element key="slowThreshold">
|
2022-06-07 14:26:09 +00:00
|
|
|
<integer>100</integer>
|
2019-06-26 02:33:14 +00:00
|
|
|
</element>
|
|
|
|
|
<element key="reportLength">
|
2023-03-09 13:08:38 +00:00
|
|
|
<integer>10</integer>
|
2019-06-26 02:33:14 +00:00
|
|
|
</element>
|
|
|
|
|
</array>
|
|
|
|
|
</arguments>
|
|
|
|
|
</listener>
|
|
|
|
|
</listeners>
|
2021-12-08 14:42:59 +00:00
|
|
|
<extensions>
|
|
|
|
|
<extension class="MediaWikiLoggerPHPUnitExtension" />
|
2023-07-12 22:59:24 +00:00
|
|
|
<extension class="MediaWikiTeardownPHPUnitExtension" />
|
2021-12-08 14:42:59 +00:00
|
|
|
</extensions>
|
2019-06-26 02:33:14 +00:00
|
|
|
</phpunit>
|