From: Antoine Musso Date: Thu, 26 Nov 2015 20:25:03 +0000 (+0100) Subject: tests: let us select/exclude ParserTests X-Git-Tag: 1.31.0-rc.0~8847 X-Git-Url: https://git.cyclocoop.org/%27%20.%20%24this-%3EgetSkin%28%29-%3EescapeSearchLink%28%29%20.%20%27?a=commitdiff_plain;h=50c5a9d27d9f254ef95247ce2784de83970532a4;p=lhc%2Fweb%2Fwiklou.git tests: let us select/exclude ParserTests The MediaWiki test suite is painfully slow and delays merging of changes. More than half of the time is spent in ParserTest_Parser⁄parserTests::testParserTest which is the PHPUnit wrapping class for the parser tests. This patch let us extract the parser tests so we can run them independently. By running them parallely with the rest of the tests, that will speed up the gate processing time. Mark the MediaWikiParserTest and NewParserTest class as belonging to the test group 'ParserTests'. Will let us filter them out via PHPUnit option --exclude-group Introduce a new PHPUnit test suite 'parsertests' which loads the MediaWiki core parser tests wrapper 'MediaWikiParserTest' and the suite which loads the extensions parser tests (ExtensionsParserTestSuite.php). This way we can run solely the parser tests with: cd tests/phpunit php phpunit.php --testsuite ParserTests Wikimedia CI can then be configure to run two jobs: A) php phpunit.php --exclude-group ParserTests B) php phpunit.php --testsuite ParserTests Bug: T114314 Change-Id: Ie819bab43163995048c073691c4c5d258f797c02 --- diff --git a/tests/phpunit/includes/parser/MediaWikiParserTest.php b/tests/phpunit/includes/parser/MediaWikiParserTest.php index 95822ad0ca..cd0f139f96 100644 --- a/tests/phpunit/includes/parser/MediaWikiParserTest.php +++ b/tests/phpunit/includes/parser/MediaWikiParserTest.php @@ -7,6 +7,7 @@ require_once __DIR__ . '/NewParserTest.php'; * an PHPUnit_Framework_Test object * * @group Parser + * @group ParserTests * @group Database */ class MediaWikiParserTest { diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index 6948082079..5c6c17d7b9 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -673,6 +673,7 @@ class NewParserTest extends MediaWikiTestCase { /** * @group medium + * @group ParserTests * @dataProvider parserTestProvider * @param string $desc * @param string $input diff --git a/tests/phpunit/suite.xml b/tests/phpunit/suite.xml index d93dafb97e..bdabdc1fcf 100644 --- a/tests/phpunit/suite.xml +++ b/tests/phpunit/suite.xml @@ -24,6 +24,10 @@ phpunit.php enables colors for other OSs at runtime languages + + includes/parser/MediaWikiParserTest.php + suites/ExtensionsParserTestSuite.php + skins structure