Commit graph

19 commits

Author SHA1 Message Date
Antoine Musso
c9c00ef397 disable ApiUploadTest
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
2012-02-06 21:39:56 +00:00
Jan Gerber
63030e19b5 Add phpunit tests for chunk upload api.
Follow up r104687
2011-12-27 05:06:41 +00:00
Aaron Schulz
5275f9b097 Merged FileBackend branch. Manually avoiding merging the many prop-only changes SVN likes to sprinkle in (easy to spot from the change list). Did not add SwiftFileBackend.php as it still is in development. 2011-12-20 03:52:06 +00:00
Platonides
a469cf2c95 Mark as FIXME. This three calls leak a png filename in sys_get_temp_dir() each,
tempnam() like, not the two-words filenames of RandomImageGenerator::getRandomFilenames()
They aren't produced by ApiTestCaseUpload::fakeUploadFile() either.
2011-11-08 22:27:25 +00:00
Alexandre Emsenhuber
681523d5ad Fix for r100905:
* Make tests work again
* Added ApiTestCase::doApiRequest() and related to pass it to the context and removed override of $wgUser where possible
* Fix ApiLogin to get the correct User object (i.e. the logged in one)
* Fix ApiBase to feed a RequestContext to setContext() so that ApiLogin can call setUser()
2011-10-27 18:46:40 +00:00
Antoine Musso
7f2e429c17 we must have a session when testing Api upload.
For some reason, the ApiUploadTest::testLogin method no more returns a valid
session. Since most, if not all, of the ApiUploadTest tests depends on it
we want that testLogin method to fail so we can skip the rest of the tests.

Test command:
  ./phpunit.php --filter ApiUpload --tap

BEFORE:
=======

TAP version 13
array(0) {
}
ok 1 - ApiUploadTest::testLogin
ok 2 - ApiUploadTest::testUploadRequiresToken
not ok 3 - Error: ApiUploadTest::testUploadMissingParams
not ok 4 - Error: ApiUploadTest::testUpload
^C

AFTER:
======

TAP version 13
not ok 1 - Failure: ApiUploadTest::testLogin
  ---
  message: 'API Login must return a session'
  severity: fail
  ...
ok 1 - # SKIP This test depends on "ApiUploadTest::testLogin" to pass.
ok 1 - # SKIP This test depends on "ApiUploadTest::testLogin" to pass.
^C ... more skips
2011-10-27 10:28:25 +00:00
Chad Horohoe
e018780327 Fixes for r92251:
* Move Imagick check into getImageWriteMethod(), adjust exception catching. Previously this was bailing on the test if you have convert but not the PHP Imagick extension. Now all these tests are passing for me again.
* Rm unused member variable, whitespace, etc
2011-08-04 22:33:04 +00:00
Ian Baker
9d4fd0c567 Refactored UploadStash and related classes to use the database for file metadata storage instead of the session, see bug 26179
Tweaked the UploadWizard to work properly with the new backend code, updated tests
2011-07-12 21:11:43 +00:00
Chad Horohoe
732e3f1271 Remove notes about being destructive. We work properly on cloned tables now 2011-07-06 17:52:27 +00:00
Chad Horohoe
25bf6f5b43 Fixed a long-standing broken test:
1) ApiUploadTest::testUploadStash
Failed asserting that <boolean:true> is false.

Did this by copying the correct stuff from $_SESSION to our local $session we're using for the test. Not sure if this is strictly correct, but hey it passes ;-)

Currently at: Tests: 1622, Assertions: 32090, Incomplete: 8, Skipped: 5.
2011-06-30 20:11:45 +00:00
Mark A. Hershberger
4e9b2c5c53 Apply modification of mdale's patch from Bug #28420: “Re-factor upload tests to support extensions extending upload test case” 2011-04-06 19:50:54 +00:00
Chad Horohoe
b661588c1f Followup r83140: FakeMemCachedClient -> EmptyBagOStuff in tests 2011-03-03 12:55:22 +00:00
Alexandre Emsenhuber
60f1302644 Per Platonides, fix for r82686: make ApiUploadTest work again
Added option request parameter to User::editToken() and User::matchEditToken() and use them where possible from the api.
Also removed $_SESSION usage since it's no longer needed
2011-03-02 12:52:47 +00:00
X!
e23d09cfee Fix r79532: Strct standards 2011-01-04 11:58:17 +00:00
X!
ad6875383b Refactor much of the API testing code.
Old: ApiWatchTest not only tested the watch module, but also tested the login module,
     and the login module test was also used to log in to the API for the other tests.
New: ApiWatchTest only contains watch-specific methods. The login testing has been moved
     to ApiTest. The code used to log in and get tokens have been moved to ApiSetup. Nice,
     organized, and much nicer than before. ApiUploadTest is still pretty fugly, though.
2011-01-02 05:52:00 +00:00
Platonides
f78ae2a51a Use an autoloader for the tests, following the ideas from r72858.
The SeleniumTestConstants class was added in r79437
2011-01-01 22:04:14 +00:00
Chad Horohoe
447529064b * verbose and color default output from phpunit
* Make a bunch of tests subclass MediaWikiTestCase
* Parser tests and ResourceLoaderTest can't subclass it yet due to various issues
2010-12-28 18:17:16 +00:00
Platonides
0a59772372 This path changed when moving the tests folder. 2010-12-16 15:09:50 +00:00
Chad Horohoe
23f69f10ed Per wikitech-l discussion: Move tests from maintenance/tests/ to tests/. They're not strictly maintenance scripts, and some people want to do a selective checkout that doesn't include the tests. There's still debate on whether we should include these in the release downloads, but we had a pretty firm consensus to move this. 2010-12-14 16:26:35 +00:00