* Remove default id/name attributes
* Remove now redundant tests introduced in r110274
* Add tests to make sure label has no 'for' attribute when label isn't null but name/id are unset
* Update tests to not include id="" and name="" when calling with no arguments
* Updating calls to add name/id if needed, and while at it remove useless 'null' params
* Context:
-- Introduced in r109990, r111376, r111315
-- No callers exist that assume these defaults. Forcing an ID that should be unique is annoying and redundant. The name used in the query when submitting a form should be mentioned in the same file where it is used from the submission, never assume what name="" is from unrelated code
-- Same for ID, this is often used in CSS or JavaScript, shouldn't be assumed. (It should be simple to but two simple namespace selectors on a page without getting DOM conflicts)
* Right now it's causing testswarm clients to have to this test 3 times, and if until bug 34820 is fixed there is no point in clogging up testswarm with it, making all IE columns uselessly red and making it harder to detect an actual regression
I am reverting, for now, two recent additions made to the table sorting:
- r111884 fractions
- r111829 IP addresses
Both need to be polished a bit more before landing in trunk. Please reapply
in a branch then once reviewed we can merge it in trunk, that will avoid
us a lot of "spam".
* Re-order special modules and add a few comments
* Single quote in QUnitTestResources.php
* Space in ResourceLoader.php
(Separated from another commit while skimming code)
* protect/protect and protect/modify were still failing because the output on IRC is not matching the i18n messages. The bots look for comment.match(<i18n-message> + (optionally) followed by ": user comment").
* The problem with protect/protect and protect/modify is that the protection settings are also inserted in somewhere in the message. Before MediaWiki 1.19 these were included in the IRC message as part of $1 (title). That may be ugly, but that's how it has always been. Since the point is to reproduce the old output we need to fix this one as well. This will make the output like:
Krinkle * protected "[[Sandbox [edit=autoconfirmed)]]"
which is exactly how it has been before and that's the the bots rely on (which was presumably done originally like that since it was the only way to make the output match the i18n message)
* Fixes more bug 34508
* assert used message-keys/variables instead of hardcoded values
* Pass $comment to the assertion helper instead of using it by default so that actions that don't use a comment (such as patrol) don't get forced a comment, to better replicate the IRC behavior
* Adding placeholder for Auto-Edit-Summary things that should also be checked in here, not sure how to do those yet
* Adding tests for block/* and protect/*
* Follows-up r12279, r112281
* Follows-up r110988: Adds test for @import (currently failing: bug 34669)
* Adding StyleTest.css.php for making this easier and re-usable
When dumping an array, PHPUnit limit the number of characters shown. That would
just hide the relevant part of the path:
1) StructureTest::testUnitTestFileNamesEndWithTest
[...]
Array (
+ 0 => '/some/path/tests/phpunit/incl...ge.php'
+ 1 => '/some/path/tests/phpunit/incl...ki.php'
)
By stripping the common path ( /some/path/tests/phpunit ), we end up with a
more useful output:
Array (
+ 0 => 'includes/RecentChange.php'
+ 1 => 'includes/Wiki.php'
)
Exif test are leaking files heavily on our test server. This quick patch make
it sure we delete temporary files.
Ideally, we should have something like a temporary filesystem backend that
would self destruct :-D
requires r112326: wfRecursiveRemoveDir()
- Update the tests to test extra characters and patterns like like \\ and $1
- Also update the tests to make sure that matches that don't have enough data to work fail
- Replace the str_replace and preg_match based code with code based on preg_replace_callback.
- mediawiki.util has dependencies as well, load order is important.
- This index.html is very hairy and most people should just ignore it, it predates the automated ResourceLoader-ified Special:JavaScriptTesting page, hence the manual dependency resolution here.
ApiUploadTest gives inconsistent results which trigger false alamrs to all
the ops team. We are disabling those tests for now.
See https://bugzilla.wikimedia.org/26169
QUnit provides a <div id="qunit-fixture"> by default that is cleared out after each test.
* Switch tests to append to the provided #qunit-fixture instead of appending to the body.
* Remove redundant .remove() calls, which now happens automatically
* Fix jquery.textSelection.test to not cause dozens of elements to be appended to the body with duplicate IDs, which was causing WebFonts test suite to fail (since the DOM can't select multiple elements with the same DOM). (Fixes r92923, r100391)
This patch fix ApiQueryTest::testTitlesGetNormalized() when $wgMetaNamespace
would contains space / underscore.
Example:
-8<-------------8<------------8<------------------8<----------8<------
1) ApiQueryTest::testTitlesGetNormalized
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
'from' => 'Project:articleA'
- 'to' => 'My_Project:ArticleA'
+ 'to' => 'My Project:ArticleA'
)
-8<-------------8<------------8<------------------8<----------8<------
This patch use Title class logic to forge a normalized title instead of
manually creating it by appending two strings.
Final fix to bug 33663 (comment 21):
https://bugzilla.wikimedia.org/show_bug.cgi?id=33663#c21
* Moved some public static functions from FileBackend to FileBackendBase as the later defines the public API.
* Made splitStoragePath() return null if the backend or container name is empty.
* Made normalizeContainerPath() kill leading directory separators.
* Added more unit tests and made some documentation tweaks.
In FSFileBackend:
* Added resolveContainerName() to disallow '.' a container name, since this would cause a traversal.
* Remove both classes before adding one. Previously test ran normally on an "ltr" page because the loop starts with "ltr" and they matches naturally. It broke on pages that started out with "rtl". Fixed now
* Restored body classes after the test, otherwise both "rtl" and "ltr" would be gone, could influence other tests and layout stuff on the page.
* Follows-up r101845
Since we're here: nothing uses $namespaceNames, $mNamespaceIds or $namespaceAliases
outside of this class (core or extensions) so lets make it protected.
* r109993 broke the test by overwriting namespaces it tried to preserve
* tearDown should always have the opposite order of the overrides in setUp
* Adding wgLanguageCode while at it, no reason not to, just in case.
-- Follows-up r109993
* Previously it was passing $selectAttribs['name'] to Xml::label, which uses its value for the <label for=""> attribute. This works as long as $selectAttribs['id'] and $selectAttribs['name'] match, but when they don't it fails. <label for=""> always corresponds with <{input,text area,select} id=""> in browsers, never with "name".
* Make name/id match eachother by default to avoid backwards compatibility breakages (they used to match in the Xml class method as well)
* Add HtmlTest.php entries similar to the ones in XmlTest
* Fix E_NOTICE about $params['selected'], default to ''
-- Follows-up r109974, r109698, r109990
-- Bug originally introduced in r41425
-- XmlTest.php still runs successfully
-- HtmlTest.php runs successfully
* Use 'b' param in some fopen() calls as needed for Windows and newline handling.
* Removed some useless padding code in FileBackend::getContainerShard(). Initialized $m to make IDE happy.
* Updated some code comments.
In SwiftFileBackend:
* Manually set the ETag when using php-cloudfiles for creating files to avoid https://github.com/rackspace/php-cloudfiles/issues/59.
* Manually set the content type based on how StreamFile::getType(). This makes it safe to read files directly out of the proxy to end-users. The streamFile() backend functions already uses a similar content-type check.
* This is in preparation for deprecating this in favor of an Html:: method soon, making sure here that tests still match afterwards
* Follows-up r109698
new FileRepo() requires an array of parameters having at least the
'name' and 'backend' key setup.
TODO: 'backend' keyword should probably default to FileBackend.
* Made FileBackend::getFileProps() final.
* Added exception needed in SwiftFileBackend::getConnection().
* Various FileBackendTests fixes and additions. Optimized it a bit by keeping the backend instance in memory.
Fixes the problems with r102179 and r102179, as there are
valid tags which begin the same, which meant they were not removed from
the TOC (the second regex, intended to remove tag parameters, then converted
<img or <blockquote> into <i> / <b>).
The same problem existed in the original regex, but as there are no valid
tags which begin with sup or sub, it never happened).
Added comment explaining the tocline regex, and added a bunch of parser tests.
* Through all QUnit updates, the html was never updated (only the JS/CSS files). Updating html now according to QUnit documentation. (introduced a new html element used for adding test document elements which are automatically cleaned up. the JS/CSS for QUnit was already referring to this but silently failing)
* In StoreBatchTest: sed proper clean() function to remove temp dirs (follows up r109641). Also removed some commented out code.
* Fixed temp dir leakage in FileBackendTest.
Some other test could have added their own logs, for example
deprecated notice. In that case, the first test will fail because
the log array already has some content :-b
The first ones were failing because the test suite ran on gallium without
MWDebug being initialized. This is now the case since r109033.
The second part was failling because PHPUnit on gallium does not have
the assertCount() method. Use a assertEquals() / count() workaround instead.
Tests added by 108873
Reverts r108877
The MySQL backend, when using temporary tables, does not support referencing
a table which was already open.
http://bugs.mysql.com/bug.php?id=10327
This patch skip BrokenRedirectsPage on MySQL as reported on r102411.
* Added SHA-1 to FileOp::attemptBatch $predicates (since concatenate was removed from FileOp). This lets us get rid of temp file backups, as the remaining failure case is just the backend medium going down (the ops would break in that case anyway). Doing so reduces RTTs and backup file I/O overhead. This also simplifies expiry object support by avoiding having to stash the expiry values of temp backup objects somewhere.
* Improved precheck() and attempt() status logic in FileOp::attemptBatch() a bit. Use separate $subStatus var to check if each op is OK.
* A few minor code cleanups and comment tweaks.
* Fixed MoveFileOp bug found in unit tests when the source/dest are the same and an overwriteDest/overwriteSame param is given (the file would just get deleted). Improved CopyFileOp in this case too.
Other:
* Added more unit tests.
* Made secure() call doPrepare() for caller dummy proofing (especially those that don't check the status).
In FSFileBackend:
* Removed redundant wfMkdirParents() calls in FSFileBackend, we already have prepare() for this purpose. This also keeps it's behavior more consistent with the other backends.
* Made use of 'backend-fail-store' message in doStoreInternal().
Other:
* Updated unit tests and renamed $src => $source in some functions for consistency.
* Added some documentation comments and @since tags.
r106780 to fix bug 33270 introduced a new bug that prevented selected
namespaces for search to be applied. This patch fix the issue.
Credits to Brad Jorsch
This is reverting the work done by MaxSem to support stored procedures
and stored function in MySQL. The reasons are:
- it is not needed yet
- tests are not functionals
- alter the stable include/db/Database.php and drop support for ';;'
So please create a branch to work on it and merge it back in trunk
once we have branched 1.19 :-)
I have opened bug 33654 to track this enhancement request.
Reverts r107376, r107994.
trunk is frozen pending stabilisation so we can release MediaWiki 1.19.
Those changes introduces API changes and new SQL tables, so that sounds like
new feature we do not have time to review right now.
Please reapply changes in branches/concurrency and have code review handled
there. Once the branch has been reviewed, please hold. Once trunk is stable
enough and 1.19 got branched, you are welcome to merge the branch in trunk.
Note: we can have a Jenkins jobs setup to run the branch tests if you need.
Reverts:
r108595 r108591 r108585 r108584 108572 r108564 108560 r108559
These fail only on sqlite, and only when run with the entire suite (they're fine when run individually).
Skipping ApiBlockTest allows ApiConcurrencyTest to run, oddly enough.
Clearly, this will need to be fixed ASAP. I'll take care of it on Thursday when I'm back online, or possibly
before.
They are now in their own files. Rewrite wfTimestamp tests to use
data providers like it should.
Originally commited without history by ^demon as r108420
the includes/parser/MediaWikiParserTest.php test case
* Drop now unused various test recorder options -- phpunit outputs its data in lots of machine-readable formats, use those if you need to work with
test data
* There's still a lot of duplication between NewParserTest::setUp() and MediaWikiTestCase, but hey one step at a time ;-)
* All tests pass for me (make phpunit && make parser)
* Made 'success', 'successCount', and 'failCount' fields reflect the overall operation in FileBackendMultiWrite::doOperationsInternal(). This makes it match up with single-write backends.
* Made FileBackend::clearCache() part of the public API.
the includes/parser/MediaWikiParserTest.php test case
* Drop now unused various test recorder options -- phpunit outputs its data in lots of machine-readable formats, use those if you need to work with
test data
* There's still a lot of duplication between NewParserTest::setUp() and MediaWikiTestCase, but hey one step at a time ;-)
* All tests pass for me (make phpunit && make parser)
* Added getFileSize()/getFileStat() functions. Refactored some functions to use the stat function for better reuse and caching/consistency.
* Refactored streamFile() to allow for subclasses to avoid local file copying with less duplication. Also make last-modified check actually work since we always get the timestamp of the original file.
* Renamed 'ignoreErrors' parameter to 'force'.
In FileBackendMultiWrite:
* Simplified how read ops are done (use 'master' backend for consistency).
* Added consistency check to doOperationsInternal() to check if the files are synced.
* Various fixes after testing.
In StreamFile:
* Split out prepareForStream() function from stream() in StreamFile for code reuse.
In FileBackendTest:
* Properly cover FileBackendMultiWrite in tests.
* Various test improvements.
* Also pass the line number
* Removed useless usage of $title when throwing the exception about invalid since that variable is always null
* Added $ignoreDuplicate parameter to ParserTest::addArticle()
* Replaced 'media' portion of container names with the repo name. This makes it easy for multiple repos to use the same backend without 'wikiId' hacks. Full container names are now like <wiki>-<repo>-<zone> (or <repo>-<zone> if 'wikiId' is set to an empty string).
* Restricted isValidContainerName() more in light of Azure portability and shorted shard suffix.
* Bumped $maxCacheSize to 75 storage paths.
* Code comment cleanups and additions.
Unit tests:
* Updated related tests and marked testBug29408() as broken (I can't find the problem).
* Reduced leakage in UploadFromUrlTestSuite a bit.
Follow up r107556 and based on the discussions on wikitech-l about this.
mediawiki.jqueryMsg is now loaded always. mw.msg uses the parser if required.
Add qunit test cases.
* Make sure FSFileIterator::current() directly returns the string path and that it is relative to the directory being searched.
* Fixed silly bug in testGetFileList that masked any bugs.
* Added a few code comments.
have any pipes after being transformed by MessageCache, causes exception on
all pages.
This can happen with lines like:
**{{#if:yes|Something}}
Thank you to liangent for figuring out how to escape a | without {{!}} existing and | not working.
* twn:
exception 'MWException' with message 'ResourceLoaderFileModule::readScriptFiles: script file not found: "/www/sandwiki/tests/qunit/suites/resources/mediawiki/mediawiki.title.test.js"' in /www/sandwiki/includes/resourceloader/ResourceLoaderFileModule.php:518
* r107919 merge broke it as it removed all the inline mw.config calls, and the tearDown is resetting them to the initial values. That works fine on a MediaWiki page but on the static page are now no variables at all. Copying a basic sample to it. This should've been in the static test suite all along actually.
* Calculating wgScriptPath based on location.pathname instead of location.href, exclude wgServer
* Follows-up r107919
Changed written by Timo and reviewed by Hashar. This should be harmless.
To enable the feature:
$wgEnableJavaScriptTest = true;
Then head to:
[[Special:JavaScriptTest/qunit]]
If the parameter passed is mw.user, use the gender from mw.user.options. If not, use the passed gender.
Update the qunit tests.
Update the documentation.
Followup r107811
* mw.config is the new way, and global config variable lookups are deprecated
* Based on two phase3-wide quick searches:
-- of " wg": http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=321&hash=81700bf7486e4fee3b7bc1f83eb9eba6
-- of "!wg": http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=327&hash=47c9d54a7a1d5d58a724dd834585f40d
Related changes:
* Changed some php comments mentioning "wg" variables to include the dollar sign, and a typo when the wf function prefix was meant.
* Removed TODO comment in wikibits.js and made it use the JS equivalent of wfUrlencode, which we have now, mw.util.wikiUrlencode
* SpecialUpload.php: use OutputPage::addJsConfigVars instead of creating a new script tag through OutputPage::addScript(Skin::makeVariablesScript(..))
* Renamed wgUploadSetup in upload.js and made it local. Not used anywhere in ./trunk/phase3 and ./trunk/extensions
* Fix OutputPage::addJsConfigVars so that it can actually be called with an array instead of two arguments for key/value
* Some minor whitespace/convention stuff around the same line
Make Language::formatNum() handle TB through YB
Rewrote code to be simpler and less indenty
Though, something like formatBitrate might be be better in future... We'll see!
* Refactored DatabaseBase::sourceStream(), made it possible for descendant classes to alter its behaviour w/o having to redo it completely like Oracle does.
* MySQL class now supports specifying DELIMITER.
* Thrown away the mess of catering for double semicolon. If it's a problem, fix your .sql files!
* Haven't actually touched Oracle.
* Tests!
* Changed concatenate to store to a specified temp FS file rather than a final storage destination. This makes it better fit the use case (chunked upload), so we can avoid extra copying around. Subclasses no longer have to implement this function now as well.
* Added extensionFromPath() helper function.
* Moved createInternal() up a bit and fixed @see comments pointing to the wrong functions.
In FSFileBackend:
* Use parent implementation of doConcatenateInternal().
In FileRepo/File:
* Added FileRepo::ALLOW_STALE and made thumbnail transforms use it.
* Refactored FileRepo::initZones() to require the specific zones; nothing was using it differently.
* Removed deleted zone check in deleteBatch(), a similar error will instead trigger with the initZones() call as needed.
* Added $wgLocalFileRepo comment.
* Updated tests.