Please can they?!
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Make the tests run in Jenkins | mediawiki/extensions/Gather | master | +148 -109 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Invalid | Tgr | T95786 Collection items should be sorted by modified time not alphabetically. | |||
Duplicate | None | T94255 UI for reordering collections | |||
Duplicate | None | T94117 API: support page reordering | |||
Resolved | Tgr | T95972 API: Change default ordering of page titles namespace | |||
Resolved | Tgr | T96904 PHPUnit tests do not get run by Jenkins for Gather commits |
Event Timeline
We run the mediawiki-extensions-hhvm and mediawiki-extensions-zend jobs which are invoking the MediaWiki core extensions testsuite:
php phpunit.php --testsuite extensions
From the test result of a random build, that lists tests SpecialGatherTest and SpecialGatherTest::testCheckRoute. So I guess it works.
Really? We submitted a patch causing tests to fail which didn't get picked up by Jenkins.
We have some api tests that should be running as well - api/GatherTests are those not being picked up?
cc @Yurik who said this wasn't setup.
I have closed the task because some random tests were showing up. Indeed api/GatherTests.php is not run because it is not recognized by the testsuite. The file suffix must be in singular form so the file has to be renamed:
- ./tests/phpunit/api/GatherTests.php ^ + ./tests/phpunit/api/GatherTest.php
The full explanation:
The tests are registered by Gather using the UnitTestsList hook which has:
$files[] = __DIR__ . '/../tests/phpunit';
The MediaWiki 'extension' testsuite is defined in tests/phpunit/suites/ExtensionsTestSuite.php. When given a directory, the suite lookups for files using the 'Test.php' suffix:
if ( is_dir( $path ) ) { $suffixes = array( 'Test.php', # Suffix used to name files ); $fileIterator = new File_Iterator_Facade(); $matchingFiles = $fileIterator->getFilesAsArray( $path, $suffixes ); $this->addTestFiles( $matchingFiles );
Renaming the file should do it.
Change 209032 had a related patch set uploaded (by Jdlrobson):
Make the tests run in Jenkins
@Tgr could you work out what's going on here and take over this patch? The tests run locally but not on Jenkins meaning we have no test coverage...
I wasn't, but at a glance the Zend issue is a real bug which depends on PHP engine and version and the other (page order in the listpages API response is different locally and in Jenkins) is maybe a side effect of different phpunit settings wrt database reuse? I would say just kill that one assertion and get the tests running on Jenkins.