From: Timo Tijhof Date: Tue, 2 Apr 2013 17:59:07 +0000 (+0200) Subject: QUnit: Ensure test modules are top loading X-Git-Tag: 1.31.0-rc.0~20130^2~1 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=8e23f3359df698ab8bd9c606db5e1246d862eb14;p=lhc%2Fweb%2Fwiklou.git QUnit: Ensure test modules are top loading Jenkins tests for extensions were exiting with a false positive. They were marked "success" but in fact were wrong because it only ran the core tests, the extensions' test suite was loaded after QUnit already stopped listening. Change-Id: I164d60e06118b64a1c6a17665a0fb1faeff744e5 --- diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 62c0822363..589a3544ce 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -287,6 +287,10 @@ class ResourceLoader { // Add the testrunner (which configures QUnit) to the dependencies. // Since it must be ready before any of the test suites are executed. foreach( $testModules['qunit'] as $moduleName => $moduleProps ) { + // Make sure all test modules are top-loading so that when QUnit starts + // on document-ready, it will run once and finish. If some tests arrive + // later (possibly after QUnit has already finished) they will be ignored. + $testModules['qunit'][$moduleName]['position'] = 'top'; $testModules['qunit'][$moduleName]['dependencies'][] = 'mediawiki.tests.qunit.testrunner'; } diff --git a/tests/qunit/QUnitTestResources.php b/tests/qunit/QUnitTestResources.php index 01072d83c4..36fdbcc3cd 100644 --- a/tests/qunit/QUnitTestResources.php +++ b/tests/qunit/QUnitTestResources.php @@ -61,6 +61,5 @@ return array( 'mediawiki.language', 'mediawiki.cldr', ), - 'position' => 'top', ) );