r107919 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107918‎ | r107919 | r107920 >
Date:18:33, 3 January 2012
Author:hashar
Status:ok (Comments)
Tags:core 
Comment:
merge JSTesting branch into trunk

Changed written by Timo and reviewed by Hashar. This should be harmless.

To enable the feature:
$wgEnableJavaScriptTest = true;

Then head to:
[[Special:JavaScriptTest/qunit]]
Modified paths:
  • /trunk/phase3 (modified) (history)
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/img_auth.php (modified) (history)
  • /trunk/phase3/includes (modified) (history)
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)
  • /trunk/phase3/includes/CategoryViewer.php (modified) (history)
  • /trunk/phase3/includes/ChangesList.php (modified) (history)
  • /trunk/phase3/includes/ConfEditor.php (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/Revision.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/SpecialPage.php (modified) (history)
  • /trunk/phase3/includes/SpecialPageFactory.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/WikiCategoryPage.php (modified) (history)
  • /trunk/phase3/includes/actions/HistoryAction.php (modified) (history)
  • /trunk/phase3/includes/api (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryImageInfo.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUpload.php (modified) (history)
  • /trunk/phase3/includes/cache/MessageCache.php (modified) (history)
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseError.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseUtility.php (modified) (history)
  • /trunk/phase3/includes/db/LoadBalancer.php (modified) (history)
  • /trunk/phase3/includes/filerepo/file/File.php (modified) (history)
  • /trunk/phase3/includes/installer/DatabaseInstaller.php (modified) (history)
  • /trunk/phase3/includes/interwiki/Interwiki.php (modified) (history)
  • /trunk/phase3/includes/json/Services_JSON.php (modified) (history)
  • /trunk/phase3/includes/libs/HttpStatus.php (modified) (history)
  • /trunk/phase3/includes/media/Exif.php (modified) (history)
  • /trunk/phase3/includes/media/ExifBitmap.php (modified) (history)
  • /trunk/phase3/includes/resourceloader/ResourceLoader.php (modified) (history)
  • /trunk/phase3/includes/specials (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBlock.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialJavaScriptTest.php (added) (history)
  • /trunk/phase3/includes/specials/SpecialUploadStash.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadBase.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadFromFile.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadStash.php (modified) (history)
  • /trunk/phase3/languages (modified) (history)
  • /trunk/phase3/languages/LanguageConverter.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesQqq.php (modified) (history)
  • /trunk/phase3/maintenance/archives (modified) (history)
  • /trunk/phase3/maintenance/cleanupTable.inc (modified) (history)
  • /trunk/phase3/maintenance/deleteSelfExternals.php (modified) (history)
  • /trunk/phase3/maintenance/findHooks.php (modified) (history)
  • /trunk/phase3/maintenance/mergeMessageFileList.php (modified) (history)
  • /trunk/phase3/maintenance/populateRevisionLength.php (modified) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/term/MWTerm.php (modified) (history)
  • /trunk/phase3/maintenance/updateCollation.php (modified) (history)
  • /trunk/phase3/resources/Resources.php (modified) (history)
  • /trunk/phase3/resources/mediawiki.special/mediawiki.special.javaScriptTest.js (added) (history)
  • /trunk/phase3/tests/parserTests.php (modified) (history)
  • /trunk/phase3/tests/phpunit/Makefile (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/1bit-png.png (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/Animated_PNG_example_bouncing_beach_ball.png (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/Gtk-media-play-ltr.svg (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/Png-native-test.png (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/QA_icon.svg (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/README (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/US_states_by_total_state_tax_revenue.svg (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/Wikimedia-logo.svg (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/Xmp-exif-multilingual_test.jpg (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/broken_exif_date.jpg (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/greyscale-na-png.png (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/greyscale-png.png (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/landscape-plain.jpg (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/portrait-rotated.jpg (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/rgb-na-png.png (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/rgb-png.png (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/test.jpg (modified) (history)
  • /trunk/phase3/tests/phpunit/data/media/test.tiff (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/api/ApiUploadTest.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/api/RandomImageGenerator.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/api/generateRandomImages.php (modified) (history)
  • /trunk/phase3/tests/qunit/QUnitTestResources.php (added) (history)
  • /trunk/phase3/tests/qunit/data/testrunner.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.byteLength.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.client.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.highlightText.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.localize.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.textSelection.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.jscompat.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiButtonsAvailabilityTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiDifferentDatabaseAccountTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiDifferntDatabasePrefixTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiErrorsConnectToDatabasePageTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiErrorsNamepageTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiHelpFieldHintTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiInstallationCommonFunction.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiInstallationConfig.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiInstallationMessage.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiInstallationVariables.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiInstallerTestSuite.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiMySQLDataBaseTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiMySQLiteDataBaseTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiOnAlreadyInstalledTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiRestartInstallationTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiRightFrameworkLinksTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiUpgradeExistingDatabaseTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiUserInterfaceTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/README.txt (modified) (history)
  • /trunk/phase3/tests/testHelpers.inc (modified) (history)
  • /trunk/phase3/thumb.php (modified) (history)

Follow-up revisions

RevisionCommit summaryAuthorDate
r107936r107919: Register new message keys for maintenance scripts, as usual...raymond20:33, 3 January 2012
r107946[JSTesting] Fix static html tests...krinkle21:53, 3 January 2012
r107949[JSTesting] Fix static html tests...krinkle22:16, 3 January 2012
r107990consistency and clarification fixes for messages merged in r107919nikerabbit07:46, 4 January 2012
r107993Typos, casing. Still don't understand "'qunit' is feed using tests/qunit/QUni...nikerabbit08:29, 4 January 2012
r108007JSTesting: make sure wrapSummaryHtml is given a valid state...hashar10:31, 4 January 2012
r108008JSTesting: escape message...hashar10:35, 4 January 2012
r108010JSTesting: javascripttest-pagetext-skin msg...hashar10:51, 4 January 2012

Comments

#Comment by Hashar (talk | contribs)   20:00, 3 January 2012

Of course the lame svn merge info are still there and the commit diff does not show up :-/

#Comment by Nikerabbit (talk | contribs)   07:59, 4 January 2012

The test suite is including tests from tests/, but that directory has .htaccess saying deny from all.

#Comment by Krinkle (talk | contribs)   16:41, 4 January 2012

Fortunately ./tests/qunit has it's own .htaccess with Allow from all, and, atleast on my local install, local directories overwrite parent directories. If this doesn't work it means either Apache is misconfigured, or perhaps you have a hardcoded rule somewhere for ./tests that isn't in SVN ?

#Comment by Nikerabbit (talk | contribs)   18:25, 4 January 2012

It's still not working for me: http://translatewiki.net/sw/Special:JavaScriptTest/qunit

0 tests of 0 passed, 0 failed.
#Comment by Nikerabbit (talk | contribs)   08:25, 4 January 2012

Linker::link( $this->getTitle( $framework ), wfMsg( "javascripttest-$framework-name" ) )

Missing escaping. Should be wfMsgHtml.

#Comment by Hashar (talk | contribs)   10:36, 4 January 2012

> Linker::link( $this->getTitle( $framework ), wfMsg( "javascripttest-$framework-name" ) )

> Missing escaping. Should be wfMsgHtml.

Escaped with r108008

#Comment by Nikerabbit (talk | contribs)   08:25, 4 January 2012

+'javascripttest-pagetext-frameworks' => '$1 is the if of the framework.',

if?

#Comment by Hashar (talk | contribs)   10:12, 4 January 2012

Issue addressed in one of the following commits.

#Comment by Nikerabbit (talk | contribs)   08:27, 4 January 2012
+                               + mw.message( 'javascripttest-pagetext-skins' ).escaped()
+                               + mw.message( 'colon-separator' ).plain()

Please have the colon in the message itself. It should probably also say Choose skin (to run the tests with)

#Comment by Hashar (talk | contribs)   10:52, 4 January 2012

> Please have the colon in the message itself. It should probably also say Choose skin (to run the tests with)

Both fixed with r108010.

#Comment by Nikerabbit (talk | contribs)   08:34, 4 January 2012

There are more messages that need escaping, like:

wfMsg( 'javascripttest-pagetext-noframework' ) . $this->getFrameworkListHtml(),
#Comment by Hashar (talk | contribs)   10:35, 4 January 2012

> There are more messages that need escaping, Escaped with r108008

#Comment by MarkAHershberger (talk | contribs)   00:26, 24 January 2012

Marking OK b/c you marked the follow-up ok.

#Comment by Nikerabbit (talk | contribs)   08:34, 4 January 2012

addHtml doesn't take two params:

$out->addHtml( $summary, 'unknownframework' );
#Comment by Hashar (talk | contribs)   10:31, 4 January 2012

Fixed in r108007. The parameter was meant to be passed to wrapSummaryHtml() just above.

#Comment by Catrope (talk | contribs)   19:34, 4 January 2012

"This should be harmless". Have you looked at the size of the revision? :D

I'll take a crack at reviewing this one today or tomorrow.

#Comment by Hashar (talk | contribs)   23:52, 4 January 2012

Harmless to production since you need to set $wgEnableJavaScriptTest = true; :-D

Status & tagging log