| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's up to the developer to choose the level of granularity they are
aspiring for in their test coverage. But that granularity level should be
reflected in @covers. When you have hundreds of lines of code testing a
single-line function (FileBackend::doOperation), that's a good hint that
something went wrong.
FileBackendTest is 2700 lines of code and appears to be aiming to test
the whole filebackend module. So I adjusted @covers to reflect that.
Change-Id: Iacd8cf475d1761c3b32c739983343619a9509d6b
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Remove wf* function dependencies. This includes wfTempDir().
Callers now should specify the directory, though it will try to do
most of the wfTempDir() logic anyway if they do not.
* Update callers to inject wfTempDir() so $wgTmpDirectory is used by
TempFSFile instead of it probing to find a valid directory itself.
* Move most of the wfTempDir() logic to TempFSFile::getUsableTempDirectory().
* Remove unused getMimeType() method.
Change-Id: Idd55936b07f9448a6c90577708722b7b52b8fe66
|
|/
|
|
| |
Change-Id: I0c3a84c2ed8b869519f4d38475a77539c24a88a8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Added HTTP options headers parameter to streamFile().
* Refactored doStreamFile() to either call StreamFile::stream()
or delagate that to the subclass. SwiftFileBackend now relays
the full Swift response rather than manually making the headers.
This also makes Range headers easy to support.
* Made use of this in img_auth.php for performance on private wikis.
* Elimate stat call in streamFile() for Swift if "headers" is empty.
* Refactored StreamFile a bit to inject request headers instead
of using the $_SERVER global. A header options parameter is used
instead, which also supports Range.
* Removed now unused prepareForStream().
* Cleaned up streamFile() unit tests.
Change-Id: I2ccbcbca6caabb8cf65bd6b3084cede2e6ea628a
|
|
|
|
| |
Change-Id: I5d3a5eb8adea1ecbf136415bb9fd7a162633ccca
|
|
|
|
| |
Change-Id: I23982bfa0548c9ea3bdb432be7982f1563930715
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PHP_CodeCoverage_Exception:
> Trying to @cover not existing method "SwiftFileBackend::sanitzeHdrs".
> Trying to @cover not existing method "LineFormatter::normalizeException".
> Trying to @cover not existing method "MonologSpi::mergeConfig".
> Trying to @cover not existing method "ProcessCacheLRU::het".
> Trying to @cover not existing method "BitmapHandler::swapICCProfile".
> Trying to @cover not existing class or interface "checkParseSafety".
> Trying to @cover not existing method "Article::__call". (was removed).
> Trying to @cover not existing method "ExtensionProcessor::extracttExtensionMessagesFiles".
> Trying to @cover not existing method "FileContentsHasher::getFileContentHash".
Makes code coverage run fail at the moment. These used to be warnings
in PHPUnit 3.x, but are now hard exceptions in PHPUnit 4.x when requesting
a coverage report.
Change-Id: If7f45ca57fd7d480d35b1414a889398837c0c472
|
|
|
|
|
|
|
|
|
|
| |
Per wikitech-l consensus:
https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html
Notes:
* Disabled CallTimePassByReference due to false positives (T127163)
Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* ApiQueryTest: One random is enough.
* FileBackendTest: More consistent and idiomatic via wfRandomString()
* MigrateFileRepoLayoutTest: Use getNewTempDirectory(). Similar to
what FileBackendTest used already.
* UploadFromUrlTestSuite: Use getNewTempDirectory().
Change-Id: I772de2134be41506d8ed08367be8c18f354bfc72
|
|/
|
|
| |
Change-Id: I7f2ad8190e1a746b6c39190b86fa9c83c5b921fe
|
|
|
|
| |
Change-Id: Iadab3d018c3559daf79be90edb23d131729bdb68
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The content type detector will now inspect the file contents
to better handle extensionless files.
Also dependency inject the callback and make the default one
use FileInfo.
Change-Id: Iad59bf6c6a416b706f976a4c425763fd30e2debb
|
|/
|
|
|
|
|
|
| |
Normalize all headers to lower case at the start of the
FileBackend operation methods. This makes it easy for
subclasses to check for certain headers, e.g. content-type.
Change-Id: Ia69976326d17a51bcaa61f2781aa669ae7bd9c28
|
|
|
|
|
|
|
|
| |
* This will defer writes to non-master backends till the
end up the web request. This is useful for multi-DC setups.
Bug: T112708
Change-Id: I118c07764dd4a4f4f2590d4548238df12860e750
|
|
|
|
| |
Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9
|
|
|
|
|
|
| |
Many of them added with commit 776c865077ea38ca1f9205ad778a600b41332d60
Change-Id: I481b15c45ead1f5f482e120cb40ea8f3297543cf
|
|
|
|
|
|
|
|
|
|
| |
- Removed space after cast
- Removed spaces in array index
- Removed double spaces
- Added spaces around string concat
- Fixed mixed tabs and spaces at begin of line
Change-Id: I38e849723f055d2d4c05cba72f5c245a28e8d5da
|
|
|
|
| |
Change-Id: Ib84ce8dc973f7e3fe688435a72f7936342b6f2dd
|
|
|
|
| |
Change-Id: I1407273175396d4d3631531ff0ca0afa3009913e
|
|
|
|
|
|
| |
* Added tests for the metadata headers portion of the code
Change-Id: I8ac65e31212b4cca4592f963e0ca5ad30e1349f7
|
|
|
|
| |
Change-Id: I2e3c3225c729e5220ca16f6ef4518da49e7f721c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are available in phpunit since 3.5.0, which I think
is reasonable to expect people to have at this point,
especially when we actually require 3.7.0 or higher in phpunit.php:
Use assertSame instead of assertArrayEquals in UIDGeneratorTest.
assertSame (and assertEqual) care about sortorder of the array,
and is perfectly sufficient in this case to check they array is correct.
if ( $puVersion !== '@package_version@' && version_compare( $puVersion, '3.7.0', '<' ) ) {
die( "PHPUnit 3.7.0 or later required; you have {$puVersion}.\n" );
}
Change-Id: Ic32ab45110e4c4304ef046ae8d0e98c741255559
|
|
|
|
| |
Change-Id: Ie980b080da2ef21ec7d9fc32f1accc55710de140
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Use MediaWikiTestCase::getNewTempFile and getNewTempDirectory
instead of wfTempDir().
The upload api tests wrote a tempnam() file directly (where
wfTempDir() is typically shared with other systems and concurrent
runs). Use MediaWikiTestCase::getNewTempFile and
getNewTempDirectory instead.
This also ensures its removal by the teardown handler without
needing manual unlink() calls. And it doesn't rely on the test
passing. (Many unlink calls where at the bottom of tests,
which wouldn't be reached in case of failure).
* For the upload test, the presistent storing of
'Oberaargletscher_from_Oberaar.jpg' (downloaded from Commons)
was removed. Note that this didn't work for Jenkins builds anyway
as Jenkins builds set $wgTmpDirectory to a unique directory
in tmpfs associated with an individual build.
* For filebackend tests, moved directory creation from the dataProvider
to the main test.
Implemented addTmpFiles() to allow subclasses to register
additional files (created by other means) to be cleaned up also.
Removed unused $tmpName and $toPath parameters in data
provider for FileBackendTest::testStore. And fixed weird double
$op2 variable name to be called $op3.
* Skipped parserTest.inc, MockFileBackend.php, and
UploadFromUrlTestSuite.php as those don't use MediaWikiTestCase.
Change-Id: Ic7feb06ef0c1006eb99485470a1a59419f972545
|
|
|
|
|
|
| |
All functionality has been moved to other places
Change-Id: I6b6b0ef846bc63108c4dff9e17098432fd9d1697
|
|
|
|
| |
Change-Id: Ia0ceea60e7ef43959f868378f3fcd463a3adf782
|
|
|
|
| |
Change-Id: I30e3cfc29a1db92e7f1b85af54db778ee639e016
|
|
|
|
| |
Change-Id: I21293be38c53b4dca3030c26a201f70d8ed243f3
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
* This can be useful for carrying over metadata when copying files around
* Also fixed a bug in sanitizeHdrs() for Swift (broken content-disposition)
Change-Id: I4534e9acac2b306086797b3677f85c05b98e39fc
|
|/
|
|
| |
Change-Id: I78cf483dde5078d4fad4e1738d8bb8a8f634e3b1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Added a new curl multi wrapper under libs/.
* Used the new MultiHttpClient class instead of CloudFiles
* Removed CDN related config and code as it does not work.
well due to mutating files and tiny purge rate limits by CDNs.
* Also removed the unused and esoteric 'swiftAnonUser' parameter.
* Support concurrent 'describe' operations.
* Set ACLs on containers on intial PUT instead of in two steps.
Previously if the second step failed, prepare() would never
set the ACLs correctly since it aborts if the container exists.
* Improve token deletion to only trigger on 401s rather than other
random errors like 50X timeouts.
* Removed duplicative getResponse* code by just using one closure
called for both the concurrent and serial cases. Both cases are
now funneled through doExecuteOpHandlesInternal().
* Add the MD5 to stat info, as it might be useful for speeding up
the copy scripts in some cases (when both backends have md5 set).
* Avoid use of trigger_error() since there is a swift log group.
* A few other small code cleanups.
Change-Id: I1adb3e2df6df8cf01d3ad74158de96ea9a79da2e
|
|
|
|
| |
Change-Id: Ic004e0d8d8efe3e4b313b737479b8098aa0048bc
|
|
|
|
| |
Change-Id: I2ef5680829048ab4fcc0a9f7ff9064d016800217
|
|
|
|
|
|
| |
* Added some b/c code with deprecation warnings
Change-Id: Ifceffbc0a37a223bcd7cd3dc60181fc85765bc46
|
|
|
|
|
|
|
|
| |
Actually this messes with the implicit backend made for things like Math (when unconfigured), which uses the "new" operator.
This reverts commit 1f129a22cbc8546b89dd4b49b2f567c1f758a968.
Change-Id: I4c72c4f7c8b82e38df5496cf2b90fc9e19c40334
|
|
|
|
|
|
|
|
|
| |
* Moved some of the graph construction work to FileBackendGroup.
This helps the code in not depending on the rest of MW so much.
* Updated tests and FileBackendMultiwrite, which are the only things
directly constructing FileBackend objects.
Change-Id: I188a053c70ce088ce34613d5db40e6708e3ea9b7
|
|
|
|
| |
Change-Id: Iff3af78e9b41c445b7f066b6c0d0f4a87d2d6c4e
|
|
|
|
|
|
|
|
|
|
| |
Most were this way already:
https://doc.wikimedia.org/mediawiki-core/master/php/html/todo.html
Ran a find/replace on the odd ones. Also made them all
lower case.
Change-Id: I70c6a69344ddebc603e9a1c1d87e3cc4f4f4c560
|
|
|
|
|
|
|
|
| |
* Used this parameter to speed up copyFileBackend.php.
* Also added mtime checks to copyFileBackend.php and a few cleanups.
* Also fixed some incorrect getDirListPageInternal/getFileListPageInternal docs.
Change-Id: I424ef238f7adf4cf1f33b74e3a4e187dcb328a99
|
|
|
|
| |
Change-Id: I16a9b42651f1cfb1a70dffbb67b7b83dfeb90d03
|
|
|
|
| |
Change-Id: Ie9f0090f626384a90b0139b9f8c2d94bf0bb8f23
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make each run of the FileBackendTest be for a different "wiki"
so you could have multiple runs at the same time without them
interfering with each other.
There's been intermittent failures on jenkins for this test. I'm
not sure if its some race condition (which wouldn't really make
sense given each run should be independent I thought), but this
can't hurt.
Change-Id: I3b639f1c783efc140028c3acdce35ef3f58bf66f
|
|
|
|
|
|
|
|
| |
Also update some previous inconsistencies pointed out by Krinkle in change IDs:
* Ide20743a2e84ff68549286120e6cff9d9f396f54
* I811ca957b6588085d67606ebc0cd4033a1e53839
Change-Id: Ife33b931870d0d7e04fcb40974997436d27f528f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Previously, for doQuickOperations(), the default move function
would just delete the file if it was moved over itself. In fact,
the php-cloudfiles bindings have this same bug in its move function.
* For both copy and move, when the source and destination are the
same path, make sure that the headers get updated as specified.
This only applies for the 'overwrite' case (not 'overwriteSame').
* Fixed bad status for doQuickOperations() when copying a file over
itself using FSFileBackend.
* Clarified the documentation for 'overwriteSame' option.
* Renamed destSameAsSource to overwriteSameCase in FileOp for clarity.
Change-Id: I3f609d9413795c654de27958b1e807b1fc785f31
|
|
|
|
|
|
|
| |
Follows-up I9d2b148e57 (including phpunit/languages this time).
Bug: 46434
Change-Id: I30e5efcd88c516121c454676bd7a18f9b7c8fca6
|
|
|
|
|
|
|
| |
* Beefed up unit tests for this case and other "ignoreMissingSource" cases
such as when the source container or parent directory do not exist.
Change-Id: Iea6dae2424edfd0c4367e5cff606c09a4e8a865b
|