Commit graph

731 commits

Author SHA1 Message Date
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Demon
0593465614 Merge "[FileBackend] Purge Swift process cache before container delete for sanity." 2012-06-04 20:46:32 +00:00
Platonides
e4b2dea3c4 Use canonical class name. Include ORMRowTest.php
Change-Id: Ia6bc39492056bb3aa3a1a17097b71b70d1344e50
2012-06-03 15:22:31 +02:00
Aaron Schulz
c20f708ffd Merge "PHP >= 5.4.0 started taking advantage of $limit optimization of wfDebugBacktrace(), which we weren't treating right." 2012-06-02 16:58:41 +00:00
Reedy
9aa347f430 Merge "Added base class for testing ORMRow deriving classes and added a mock implementation in order to test the abstract parent class itself" 2012-06-01 14:29:07 +00:00
Platonides
2e506c4809 PHP >= 5.4.0 started taking advantage of $limit optimization of wfDebugBacktrace(),
which we weren't treating right.

* $limit in wfDebugBacktrace() is the number of returned frames,
we thus need to take into account the wfDebugBacktrace() frame, which
is sliced from debug_backtrace().

* wfGetCaller() needs to add a level for itself.

* MWDebug::warning() was logging itself as the warning issuer,
which is useless (the call a few lines before was right, though)
MWDebugTest.php changed accordingly.

* Removed double call to wfGetCaller( $callerOffset + 1 )

* Documented the meaning of wfGetCaller() parameter

* Added unit test

Change-Id: Ief50f4c810bad8b03bb2bf9dc6d945d9acb29851
2012-05-31 17:32:33 +02:00
Max Semenik
aa305c06fe mobile sub-directories for mobile-related code
Move DeviceDetection.php and DeviceDetectionTest.php

Change-Id: Ia4aaf7ad499dd2021ef9d2ebf7f6d829e8fc4656
2012-05-29 16:48:28 +02:00
Platonides
d97b7d6bc1 tests covering WebRequest->getAcceptLang()
Change-Id: I981574e854bc43aba2bd5def7cb6b1b665c5b6ca
2012-05-29 14:45:34 +02:00
jeroendedauw
298c8b4786 Added base class for testing ORMRow deriving classes and added a mock implementation in order to test the abstract parent class itself
Patchset 2: attempt to fix sql error when using sqlite
Patchset 3: for great justice
Patchset 4: sqlite, not postgres... /facepalm
Patchset 5: joy, more sql divergence...
Patchset 7: handle inconsistencies in MWs database abstraction layer

Change-Id: I1948c4ad815008321801c93584eb249c1f597560
2012-05-28 17:35:05 +02:00
Aaron Schulz
6435a6e737 [FileBackend] Purge Swift process cache before container delete for sanity.
* Also tweaked some documentation.

Change-Id: I89369d6211de216193ae1d895356137cacded5d7
2012-05-25 03:41:12 -07:00
Platonides
9180ab0b7c Make it work in wikis not configured in English.
(hardcodes message values)
 php phpunit.php includes/WikiPageTest.php

Change-Id: I4b93d983f467fd281695be5ac778d30db0b09c17
2012-05-23 23:09:15 +02:00
Aaron Schulz
723b886429 [FileBackend] Avoid an extra RTT on Swift listing operations.
* Also tweaked timestamp tolerance in tests, intended for Swift
* Also made a few tweaks to speed up tests a bit

Change-Id: Ibdee36d3bf86089b027dc74bb2582acc1ab4b96b
2012-05-22 10:53:48 -07:00
daniel
fa132be893 fix for Ibe3e88fa: restoring doDeleteUpdates().
When generalizing LinksUpdate to DataUpdate and introducing
WikiPage::getDeletionUpdates(), WikiPage::doDeleteUpdates()
was removed, even though it was still used by Title::moveToInternal().

This patch restores WikiPage::doDeleteUpdates(), using the
new logic based on WikiPage::getDeletionUpdates() to implement it.

Change-Id: I12a49d5ca3ccb6bb9cbb63dde436bcf2a7d8a985
2012-05-18 18:58:21 +02:00
Aaron
957f09b8a4 [FileBackend] Added doQuickOperations() function for things like purging thumbnails.
* doQuickOperations() lets us do things like purge thumbnails as fast as possible.
  Stat calls, SHA1 checks, and RTTs in general are avoided. It also avoids the
  slowness of lazy population of thumbnail SHA1s in Swift (for those made by rewrite.py).
* Removed supportedOperations() to avoid the extra complexity.
* Made a few variable type and exception documentation cleanups.
* Cleaned up unit test file removal a bit and made some functions private.

Change-Id: I6922368c6af7752a6927d96402519132203108a1
2012-05-16 10:30:34 -07:00
Reedy
df7b1cc716 Merge "[IP] Added an IP::prettifyIP() function for displaying IPs." 2012-05-15 19:10:51 +00:00
Tim Starling
6e49b1a966 Merge "[FileBackend] Added support for concurrent file write operations." 2012-05-14 07:23:29 +00:00
Aaron Schulz
8c8b289955 Merge "Introducing LinksUpdateTest." 2012-05-13 17:24:34 +00:00
daniel
50ee1d23e5 Introducing LinksUpdateTest.
This test case is intended to test the updating of various links
tables using a LinksUpdate object, based on the information in
a ParserOutput object.

Patch set 3: Suggestions by Aaron:
             factored assertSelect() out into MediaWikiTestCase.
             Force sorting of result set under testing.

Change-Id: I2d01e67ee7396080a04e5dff637aca0dc159c65d
2012-05-13 17:07:10 +02:00
Reedy
c68ca4228e Merge "Integrating mobile device detection class into MW core" 2012-05-11 22:50:35 +00:00
Aaron
456177bdee [IP] Added an IP::prettifyIP() function for displaying IPs.
Change-Id: I53b3fe70bd0091ef02740f2b8950c36a0e4cf32e
2012-05-11 10:53:14 -07:00
umherirrender
e9fa97f76e Add unit test for MWNamespace::isNonincludable
rename MWNamespace::isNonincludableNamespace
to MWNamespace::isNonincludable, because "Namespace" is already in the
class name

Change-Id: Ie982835c7dc84cb10c823996e5360cc1b342f704
2012-05-11 19:52:34 +02:00
awjrichards
8653accc60 Integrating mobile device detection class into MW core
Change-Id: Ic7bbeba746ea37a92c1df5dbaa1fb4fd08da130c
2012-05-09 14:28:16 -07:00
Aaron
23a0490b78 [FileBackend] Added support for concurrent file write operations.
* FS backends work via popen() and basic shell commands.
* Swift backends use the custom SwiftCloudFiles async features.
* Refactored storagePathsRead()/storagePathsChanged() to normalize the paths
  for correct dependency detection in FileOpBatch.
* Cleaned up SwiftFileBackend exception handling to make debugging easier.
* Added a quick and dirty performance testing script.
* Updated unit tests to include a run with parallelize=implicit.
* Improved file test failure output a bit.

Change-Id: I6a5ed743c30c598e0dd7301dbdb3631c460332fd
2012-05-09 05:37:41 -07:00
Aaron Schulz
a9e028e5a8 [FileBackend] File locking fixes.
* Fixed unlocking logic in FSLockManager for case when an EX lock was made, then an SH one, and then the EX one was "unlocked"
* Avoid hiding useful unlink() warnings in FSLockManager
* Reduced locking use in test cleanup code
* Added a simple testLockCalls() test function
* Made a few cleanups & fixes to backend tests

Change-Id: I1110d9b537c450d9feca5a2fb35519c22435e81d
2012-05-08 01:51:57 -07:00
Aaron Schulz
bc2b3e055c Merge "Adding $this->tablesUsed to RevisionStorageTest." 2012-05-07 22:53:13 +00:00
daniel
479711159c Adding test case for basic WikiPage functionality, including database interaction.
New tests are added to avoid regressions when the ContentHandler facility
is introduced.

Changeset 3: use tablesUsed to allow database cleanup after test, as per
             Aaron's suggestion.

Changeset 4: use array_merge instead of +=.

Changeset 5: trying dumber rollback test to see of jenkins likes it better.

Change-Id: I0a9f8dfd30031baa4b12cc128a39059868149884
2012-05-07 14:57:30 -07:00
daniel
9b98d16996 Adding $this->tablesUsed to RevisionStorageTest.
This is a follow-up to I6934d03e (no 6414).

Declare tables in $this->tablesUsed to allow for database clenaup,
as Aaron suggested.

Change-Id: Iac05b0428b335879729f6d3b993eac0d3151429c
2012-05-07 14:46:25 -07:00
Werdna
a97f5a1134 Merge "(bug 18195) Allow changing preferences via API" 2012-05-04 05:53:06 +00:00
Aaron Schulz
56c13312da Merge "Adding test case for testing revision storage and retrieval." 2012-05-03 22:39:14 +00:00
daniel
0b5f8c4cd0 Adding test case for testing revision storage and retrieval.
New tests are added to avoid regressions when the ContentHandler facility is introduced.

Change-Id: I6934d03e9df74930998d771f64fe4f4fe5555967
2012-05-02 19:34:35 +02:00
daniel
d85bbb1074 Adding more tests for Title.
This introduces tests for isCssJsSubpage, isCssOrJsPage, and isWikitextPage.

New tests are added to avoid regressions when the ContentHandler facility is introduced.

Change-Id: I68987490b01242cc0bcdc0d9dfaa99f1227f71a0
2012-05-02 19:32:56 +02:00
Aaron Schulz
f4ead22497 Merge "enable email for PreferencesTest.php" 2012-05-01 23:04:53 +00:00
umherirrender
bd27932f55 Set CdbTest to skipped instead of incomplete
When the native support is not available, the test is not incomplete.
See also the DiffBlob test and xdiff.

Change-Id: I16c14efc3f24e4171a699390d99ca6509d6a28c8
2012-04-30 09:49:31 +02:00
umherirrender
3098babc35 enable email for PreferencesTest.php
The tests in PreferencesTest.php checking email things,
enable email to let the test run complete and not depend on the wiki
setting.

Change-Id: I21b34b31c52a10e0f4f6b918ee25d98a97ea5981
2012-04-30 09:29:45 +02:00
Platonides
fdc857b73e Change CRLF line ending in GenderCacheTest.php
Edited in windows with no autocrlf set?

Change-Id: I955f0ed1fad9c4e5c143324b163a4b3c81a3f733
2012-04-28 17:18:22 +02:00
Platonides
1ceb4b671f Really use the global variable. Fixes bug in c4507 (4989dd)
Change-Id: I4733a3d8949d76044ba90e672395299f6623cecf
2012-04-28 17:12:38 +02:00
Brion VIBBER
e8eddd20de Merge "[FileBackend] Added 'recursive' flag to directory clean() function." 2012-04-26 23:30:05 +00:00
Brion VIBBER
ece03cc143 Merge "strip off subpages direct in GenderCache" 2012-04-26 23:21:43 +00:00
Aaron
104e8bb0d7 [FileBackend] Added 'recursive' flag to directory clean() function.
Change-Id: I8fadd25c05840e2324bf8433dc0a4846daf8e2c3
2012-04-26 12:41:33 -07:00
Aaron Schulz
dd5326ccf1 [FileBackend] Added some basic directory functions.
* Added directoryExists() function to check if a dir exists.
* Added getDirectoryList() and getTopDirectoryList() functions to list out subdirs.
* Added getTopFileList() function to list out immediate files in a dir. This wraps getFileList(), which was modified.

Change-Id: I087835f40d76c41f5d6af55b9a34a51e0f44a675
2012-04-21 21:33:41 -07:00
umherirrender
4989ddd423 strip off subpages direct in GenderCache
LinkBatch can also give subpages to the GenderCache and therefor it is
easier to do it always in GenderCache, than in LinkBatch and Title

Add unit tests for GenderCache

Change-Id: Ia936ff8bb639a197b0b3a8e07c97a66edd57dd10
2012-04-21 10:34:22 +02:00
Christian Aistleitner
cc13cf0564 Increase permitted runtime for testParserTest
Change-Id: Id8a73b2d5d32af38c6856c3120394a2d6150f835
2012-04-20 20:00:36 +02:00
Szymon Świerkosz
a6cd69d83a (bug 18195) Allow changing preferences via API
I have created an API module for changing the preferences.
It allows resetting preferences (reset argument) and bulk changes
of preferences (change argument) in a format:
name1=value1|name2=value2

The change argument has a limitation imposed by the current API
implementation as it cannot accept | in values. There is
available a pair of arguments optionname and optionvalue, the
latter accepts values with |.

I have created optionstoken parameter in meta=userinfo to provide
a token. There is already preferencestoken there, but I would
like to have a consistent naming.

Change-Id: I0d6c654a7354ba77e65e338423952a6a78c1150f
2012-04-20 16:56:27 +10:00
Reedy
9e33a6c740 assertEquals is $expected, $actual, not $actual, $expected
Fix Title related tests that are the wrong way round (noticed by Daniel Kinzler
when creating more tests, and wondering why phpunit was making error messages
that didn't make any sense!)

public static function assertEquals($expected, $actual, $message = '',
    $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)

Change-Id: I09aeb7cb7edb8e486ccf2f54673f91cd9704cd3b
2012-04-18 16:03:46 -07:00
Aaron
41831cbcfe Fixed silly backend test config bug.
Change-Id: I35b53dc609acb720c64f236cb58f91a73604e2f8
2012-04-17 10:25:52 -07:00
Antoine Musso
2389ec7141 MockOutputPage class in its own file
The MockOutputPage can be needed in various tests suite beside
GlobalFunctions. Seems to make sense to get it in its own class so we
can easily use it.

Change-Id: Icbb34db81e8cc8636d95f6326dd228bc74a741d7
2012-04-13 12:47:19 +02:00
Brion VIBBER
9791a4e52d Merge "Employing MediaWikiTestCase's temporary file methods" 2012-04-10 20:54:36 +00:00
Aaron Schulz
e82c2cc7ee Merged r114672 from wmf1.19 plus tests; crosswiki block name/id fix.
Change 1:
* Delete any pre-existing block for the tests
* Renamed test function and fixed comment typo

Change-Id: I4804ccae81dd0455e9d3ddf48960c4b5cd6e4f5f
2012-04-10 09:49:52 -07:00
Christian Aistleitner
282554eb33 Employing MediaWikiTestCase's temporary file methods
Change-Id: Ide86541abf6642791c1466a2075436a9df6bdbed
2012-04-10 17:08:06 +02:00