From 0e9f24a169fdb9b9eead67d555743319dea503d7 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 16 Dec 2014 01:18:16 +0000 Subject: [PATCH] Remove $wgJavaScriptTestConfig The config variable itself and the documentation property were added in MediaWiki 1.19 (r107919 / c447423593). The testswarm-injectjs propert was added in MediaWiki 1.20 (5e590be3d6). We never actually ended up using TestSwarm, and this variable is not used anywhere I can see. Having a configuration variable for a documentation page seems odd. I can't find another instance of this. As it's tied to development (not for users of the wiki), link to mediawiki.org direcly. Change-Id: Ib16607683a293b6d6661ed0411dad9a3ff551a08 --- RELEASE-NOTES-1.25 | 1 + includes/DefaultSettings.php | 19 ------------------- includes/specials/SpecialJavaScriptTest.php | 12 ++---------- tests/qunit/data/testrunner.js | 17 ++--------------- 4 files changed, 5 insertions(+), 44 deletions(-) diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index ebe4a72c25..e8b1162c84 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -12,6 +12,7 @@ production. * $wgPageShowWatchingUsers was removed. * $wgLocalVirtualHosts has been added to replace $wgConf->localVHosts. * $wgAntiLockFlags was removed. +* $wgJavaScriptTestConfig was removed. * Edit tokens returned from User::getEditToken may change on every call. Token validity must be checked by passing the user-supplied token to User::matchEditToken rather than by testing for equality with a diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 4a6aa0be44..4261c68b43 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -5481,25 +5481,6 @@ $wgParserTestFiles = array( */ $wgEnableJavaScriptTest = false; -/** - * Configuration for javascript testing. - */ -$wgJavaScriptTestConfig = array( - 'qunit' => array( - // Page where documentation can be found relevant to the QUnit test suite being ran. - // Used in the intro paragraph on [[Special:JavaScriptTest/qunit]] for the - // documentation link in the "javascripttest-qunit-intro" message. - 'documentation' => '//www.mediawiki.org/wiki/Manual:JavaScript_unit_testing', - // If you are submitting the QUnit test suite to a TestSwarm instance, - // point this to the "inject.js" script of that instance. This is was registers - // the QUnit hooks to extract the test results and push them back up into the - // TestSwarm database. - // @example 'http://localhost/testswarm/js/inject.js' - // @example '//integration.mediawiki.org/testswarm/js/inject.js' - 'testswarm-injectjs' => false, - ), -); - /** * Overwrite the caching key prefix with custom value. * @since 1.19 diff --git a/includes/specials/SpecialJavaScriptTest.php b/includes/specials/SpecialJavaScriptTest.php index a61a673c5d..65ddb31b8e 100644 --- a/includes/specials/SpecialJavaScriptTest.php +++ b/includes/specials/SpecialJavaScriptTest.php @@ -135,14 +135,13 @@ class SpecialJavaScriptTest extends SpecialPage { */ private function initQUnitTesting() { $out = $this->getOutput(); - $testConfig = $this->getConfig()->get( 'JavaScriptTestConfig' ); $out->addModules( 'test.mediawiki.qunit.testrunner' ); $qunitTestModules = $out->getResourceLoader()->getTestModuleNames( 'qunit' ); $out->addModules( $qunitTestModules ); $summary = $this->msg( 'javascripttest-qunit-intro' ) - ->params( $testConfig['qunit']['documentation'] ) + ->params( 'https://www.mediawiki.org/wiki/Manual:JavaScript_unit_testing' ) ->parseAsBlock(); $header = $this->msg( 'javascripttest-qunit-heading' )->escaped(); $userDir = $this->getLanguage()->getDir(); @@ -160,16 +159,9 @@ HTML; $out->addHtml( $this->wrapSummaryHtml( $summary, 'frameworkfound' ) . $baseHtml ); // This special page is disabled by default ($wgEnableJavaScriptTest), and contains - // no sensitive data. In order to allow TestSwarm to embed it into a test client window, + // no sensitive data. In order to allow test frameworks to embed it into a test client window, // we need to allow iframing of this page. $out->allowClickjacking(); - - // Used in ./tests/qunit/data/testrunner.js, see also documentation of - // $wgJavaScriptTestConfig in DefaultSettings.php - $out->addJsConfigVars( - 'QUnitTestSwarmInjectJSPath', - $testConfig['qunit']['testswarm-injectjs'] - ); } /** diff --git a/tests/qunit/data/testrunner.js b/tests/qunit/data/testrunner.js index b800bc251c..7294d62b42 100644 --- a/tests/qunit/data/testrunner.js +++ b/tests/qunit/data/testrunner.js @@ -30,6 +30,8 @@ // and assuming failure. QUnit.config.testTimeout = 30 * 1000; + QUnit.config.requireExpects = true; + // Add a checkbox to QUnit header to toggle MediaWiki ResourceLoader debug mode. QUnit.config.urlConfig.push( { id: 'debug', @@ -37,21 +39,6 @@ tooltip: 'Enable debug mode in ResourceLoader' } ); - QUnit.config.requireExpects = true; - - /** - * Load TestSwarm agent - */ - // Only if the current url indicates that there is a TestSwarm instance watching us - // (TestSwarm appends swarmURL to the test suites url it loads in iframes). - // Otherwise this is just a simple view of Special:JavaScriptTest/qunit directly, - // no point in loading inject.js in that case. Also, make sure that this instance - // of MediaWiki has actually been configured with the required url to that inject.js - // script. By default it is false. - if ( QUnit.urlParams.swarmURL && mw.config.get( 'QUnitTestSwarmInjectJSPath' ) ) { - jQuery.getScript( QUnit.fixurl( mw.config.get( 'QUnitTestSwarmInjectJSPath' ) ) ); - } - /** * CompletenessTest * -- 2.20.1