Commit graph

11 commits

Author SHA1 Message Date
jenkins-bot
5127fe1b43 Merge "Add MediaWikiIntegrationTestCase::runJobs() and use it" 2021-05-05 03:15:17 +00:00
Tim Starling
0e05879d7e Add MediaWikiIntegrationTestCase::runJobs() and use it
JobRunner catches all exceptions and hides them in the status array,
meaning that it is not obvious when a job fails during a test case.
So, introduce MediaWikiIntegrationTestCase::runJobs(), which runs jobs
and asserts various things about the returned status array.

Depends-On: I4f4790c5d16a0767790eeff202e0be8fcdaeda93
Depends-On: I118f9e3f8950fd82d7b02baed6705b29fd6ab7d5
Change-Id: I63603aa158f77df4b40add096cb248f3b24979f4
2021-05-05 02:51:30 +00:00
James D. Forrester
df5eb22f83 Replace uses of DB_MASTER with DB_PRIMARY
Just an auto-replace from codesniffer for now.

Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
2021-04-29 09:24:31 -07:00
Daimona Eaytoy
535d7abf59 phpunit: Mass-replace setMethods with onlyMethods and adjust
Ended up using
  grep -Prl '\->setMethods\(' . | xargs sed -r -i 's/setMethods\(/onlyMethods\(/g'

special-casing setMethods( null ) -> onlyMethods( [] )

and then manual fix of failing test (from PS2 onwards).

Bug: T278010
Change-Id: I012dca7ae774bb430c1c44d50991ba0b633353f1
2021-04-16 20:15:00 +02:00
Umherirrender
a1de8b8700 Tests: Mark more more closures as static
Result of a new sniff I25a17fb22b6b669e817317a0f45051ae9c608208

Bug: T274036
Change-Id: I695873737167a75f0d94901fa40383a33984ca55
2021-02-09 02:55:57 +00:00
Reedy
eb41565a9a Tests: Start marking some closures as static
Bug: T274036
Change-Id: Ib738ecd3bc23d34900bc268c8246702ac3655746
2021-02-06 19:57:42 +00:00
addshore
959bc315f2 MediaWikiTestCase to MediaWikiIntegrationTestCase
The name change happened some time ago, and I think its
about time to start using the name name!
(Done with a find and replace)

My personal motivation for doing this is that I have started
trying out vscode as an IDE for mediawiki development, and
right now it doesn't appear to handle php aliases very well
or at all.

Change-Id: I412235d91ae26e4c1c6a62e0dbb7e7cf3c5ed4a6
2020-06-30 17:02:22 +01:00
Umherirrender
a8161ec101 Add missing visibility on methods of deferred related classes
Change-Id: I959f95a46b7b0bc0973154231c72bdb787fffa53
2020-05-10 22:15:41 +00:00
Brad Jorsch
b8858d6d5b RefreshSecondaryDataUpdate: Commit before running sub-updates
The call to `$this->updater->getSecondaryDataUpdates()` probably started
an implicit transaction, and a sub-update may have tried to register a
callback to watch for a rollback which would make that implicit
transaction non-empty.

Bug: T248003
Change-Id: Ib9db8ec9c43c8b2871f283733ed6a05d2dec6dd1
2020-04-09 11:17:00 -04:00
Nikki Nikkhoui
8b43050319 Set logger to null in RefreshSecondaryataUpdateTest integration test
The code is appropriately logging when it encounters an exception.
However, the CI interprets that as an actual exception being thrown.
Setting the logger to null allows the CI to complete.

Bug: T248189
Change-Id: I9ce7c451b9951892e509afa048213e7691498e47
2020-03-27 10:56:05 -07:00
Aaron Schulz
1f4efc6c34 Add RefreshSecondaryDataUpdate and use it in DerivedPageDataUpdater
This class implements EnqueueableDataUpdate and can be pushed as a
job if it fails to run via DeferredUpdates.

Unlike a1f7fd3ada, make RefreshSecondaryDataUpdate skip failing
updates in doUpdate(). Instead of throwing the first exception from
any update, log any exceptions that occur and try all the other
updates. The first error will be re-thrown afterwards.

Also, make sure that each DataUpdate still has outer transaction
scope. This property is documented at mediawiki.org and should not
be changed.

Add integration tests for RefreshSecondaryDataUpdateTest.

Bug: T218456
Bug: T206283
Change-Id: I7c6554a4d4cd76dfe7cd2967afe30b3aa1069fcb
2020-03-11 00:42:48 -07:00