wiki.techinc.nl/phpunit.xml.dist
Daimona Eaytoy b04576b3be phpunit: Sync phpunit.xml.dist with tests/phpunit/suite.xml
Since the latter is going to be removed, make sure that the former has
everything we need. In particular:
- Add failOnRisky=true from suite.xml
- Reorder config options and add comment about stderr from suite.xml
- Remove non-existent tests/phpunit/skins and
  tests/phpunit/documentation from the test suites. These cause an error
  when trying to run all the suites with `composer phpunit`.
- Leave the other suites as they are. Compared to suite.xml,
  phpunit.xml.dist has separate suites for core, extensions, and skins
  unit tests.
- Leave includeUncoveredFiles to false. The rationale in
  I3d19627fa36f6cc6666c29fdb638272fdaa30630 seems convincing. CI already
  sets it to true: https://w.wiki/72qE
- Leave slowThreshold to 100 as per
  Ia6ed404d4d4cc8a7b4b8a48b232f644f400f8103. I believe that change
  simply missed suite.xml. The same rationale that led to the threshold
  being increased for unit tests is valid a fortiori for integration
  tests, which are generally slower.

Rename SuiteDirectoryTest and make it check phpunit.xml.dist too.

Bug: T227900
Change-Id: Ib4b47b337870dffc61dd44817a21d11809075d5b
2023-07-14 20:59:42 +00:00

103 lines
3.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="tests/phpunit/bootstrap.php"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
colors="true"
backupGlobals="false"
convertDeprecationsToExceptions="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="true"
failOnWarning="true"
stopOnFailure="false"
failOnRisky="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
verbose="false"
printerClass="MediaWikiPHPUnitResultPrinter"
stderr="true">
<!-- Output only to stderr to avoid "Headers already sent" problems -->
<php>
<ini name="memory_limit" value="-1" />
<ini name="max_execution_time" value="0" />
</php>
<testsuites>
<testsuite name="core:unit">
<directory>tests/phpunit/unit</directory>
</testsuite>
<testsuite name="extensions:unit">
<directory>extensions/*/tests/phpunit/unit</directory>
</testsuite>
<testsuite name="skins:unit">
<directory>skins/*/tests/phpunit/unit</directory>
</testsuite>
<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>
</testsuite>
<testsuite name="structure">
<directory>tests/phpunit/structure</directory>
</testsuite>
<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>
</testsuite>
</testsuites>
<groups>
<exclude>
<group>Broken</group>
</exclude>
</groups>
<coverage includeUncoveredFiles="false">
<include>
<directory suffix=".php">includes</directory>
<directory suffix=".php">languages</directory>
<directory suffix=".php">maintenance</directory>
<directory suffix=".php">extensions</directory>
<directory suffix=".php">skins</directory>
</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>
<listeners>
<listener class="JohnKary\PHPUnit\Listener\SpeedTrapListener">
<arguments>
<array>
<element key="slowThreshold">
<integer>100</integer>
</element>
<element key="reportLength">
<integer>10</integer>
</element>
</array>
</arguments>
</listener>
</listeners>
<extensions>
<extension class="MediaWikiLoggerPHPUnitExtension" />
<extension class="MediaWikiTeardownPHPUnitExtension" />
</extensions>
</phpunit>