From 8e23f3359df698ab8bd9c606db5e1246d862eb14 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 2 Apr 2013 19:59:07 +0200 Subject: [PATCH] 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 --- includes/resourceloader/ResourceLoader.php | 4 ++++ tests/qunit/QUnitTestResources.php | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) 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', ) ); -- 2.20.1