Commit graph

15417 commits

Author SHA1 Message Date
Aaron Schulz
892c3383dd objectcache: clarify usage of getMultiWithUnionSetCallback()
The examples and comments were misleading with regard to the handling
of missing entities.

Bug: T303092
Change-Id: Ib672fd18d1270c35253683eb54b48be056e6dc3c
2022-03-17 17:40:45 +00:00
jenkins-bot
a41d695814 Merge "tests: Make sure deferred updates are done and re-enable TemplateCategoriesTest" 2022-03-17 13:19:30 +00:00
Func
53afd761b0 tests: Make sure deferred updates are done and re-enable TemplateCategoriesTest
LinksUpdate is a group of deferrable updates, not jobs till now.
See HtmlCacheUpdater::purgeTitleUrls().

Bug: T165099
Change-Id: Icf40c4ff9e14ee06d48600bcbfdc39e2baf68b23
2022-03-17 13:01:08 +00:00
jenkins-bot
67a520437d Merge "SuiteEventsTrait: don't call setUp() for an empty suite" 2022-03-17 10:31:10 +00:00
Tim Starling
43db499d13 SuiteEventsTrait: don't call setUp() for an empty suite
SuiteEventsTrait is a hack to support the parser test suite classes. If
the suite is empty due to e.g. group filters, doing setUp() and
tearDown() is unnecessary and expensive (requiring DB cloning). Also,
errors from setUp() or tearDown() on an empty suite were not properly
handled.

So if the suite is empty, do the same thing as TestSuite::run(), leave
the result unmodified.

Bug: T292239
Change-Id: I0828257d6dd0bbc5b1633afde5ff162e96169675
2022-03-17 14:47:21 +11:00
Aaron Schulz
eed58f2f61 rdbms: fix owner id and RELEASE_ALL_LOCKS query in session flushing methods
Use the LoadBalancer id in flushPrimarySessions(), not the LBFactory one,
and use assertOwnership() to check $owner, similar to other methods.

In DatabaseMysqlBase::doFlushSession(), change RELEASE_ALL_LOCKS() query
to use RELEASE_LOCK(), since only newer MariaDB versions (>=10.5.2) support
it. No errors were thrown in the method since they are suppressed, but the
syntax error would cause the transaction to be placed in an error state.

Add assertion to testTransactionCallbackChains() that would otherwise fail.

Randomize lock names in lock() tests to avoid contention.

Bug: T292239
Bug: T303887
Follow-Up: ee3c65d541
Follow-Up: 4cac31de4e
Change-Id: I414d737028338cfd5369eee24576df4aa26a2f6f
2022-03-17 02:55:43 +00:00
jenkins-bot
4a1adcda44 Merge "ParserTestRunner: Remove unused property $dbClone" 2022-03-17 02:07:37 +00:00
jenkins-bot
cc5ccc0b4e Merge "Add convenience methods for asserting status." 2022-03-17 01:46:17 +00:00
Umherirrender
9327bdd953 tests: Fix @group Broken on MediaWikiIntegrationTestCaseSchemaTest
Group names can contains spaces in phpunit

Bug: T292239
Follow-Up: I7061f5e630858443e9127c3267069ae6bba192e2
Change-Id: I3b2e5a630e40bc55368784885ae221b0f925711b
2022-03-16 21:50:33 +00:00
daniel
e239b02a5e Add convenience methods for asserting status.
This ensures that assertions work in a uniform way,
and provides meaningful messages in cause of failure.

Change-Id: Ic01715b9a55444d3df6b5d4097e78cb8ac082b3e
2022-03-16 22:44:25 +01:00
jenkins-bot
5ec380a8f6 Merge "Integration test for extension registration" 2022-03-16 17:05:36 +00:00
Ammarpad
e8d2f182e6 ParserTestRunner: Remove unused property $dbClone
Also fix type doc of $fileBackendName.

Change-Id: Ifac11a89c0a4bf8c8c0c6219d2751813cd52b3ea
2022-03-16 16:42:09 +00:00
jenkins-bot
602d477ad8 Merge "Improve ensureMockDatabaseConnection() error message" 2022-03-16 12:38:31 +00:00
jenkins-bot
27ba493b70 Merge "Bump minimum required version for upgrade to 1.31" 2022-03-16 07:53:53 +00:00
Aaron Schulz
7ee3bc9334 Improve ensureMockDatabaseConnection() error message
Bug: T292239
Change-Id: I8f892d0148cbd3f475751d71143ac07a4b3b29d6
2022-03-15 20:07:57 -07:00
jenkins-bot
b5dd025fcb Merge "ParamValidator: Allow to use User:0 in UserDef" 2022-03-15 23:25:24 +00:00
Alexander Vorwerk
006c5a1314 Hard deprecate PageProps::getInstance()
No usages in Wikimedia-deployed extensions left.

Bug: T289544
Change-Id: Ia94a913d9b406c8a74ef41a82f502ebf0205667c
2022-03-15 22:58:48 +01:00
Umherirrender
67f6d2c8da ParamValidator: Allow to use User:0 in UserDef
UserNameUtils returns string|false. Check explicit for false to take the
string '0' as valid, which was a falsy check before.

Change-Id: I04c6b5303f9c2356ca85855686694b48f6448d56
2022-03-15 22:25:35 +01:00
Alexander Vorwerk
d66fe8b7c7 Bump minimum required version for upgrade to 1.31
The policy allows this and since 1.39 is going to be the next LTS
release, I think it is fine to do this now.

Change-Id: If426e0ee349252ccc0ba9c4222c7d6865ab57fa2
2022-03-15 22:12:59 +01:00
jenkins-bot
f426a261ff Merge "rdbms: Remove deprecated IDatabase functions" 2022-03-15 20:28:56 +00:00
jenkins-bot
02d2459fe1 Merge "tests: Remove unused mock of getLazyConnectionRef" 2022-03-15 20:00:01 +00:00
Amir Sarabadani
46374a8e3e rdbms: Remove deprecated IDatabase functions
Soft-deprecated in 1.37, hard-deprecated in 1.38

Bug: T286694
Change-Id: Icd23271149bba3e4632d595c057a733d13707503
2022-03-15 19:33:32 +01:00
jenkins-bot
3e1ef14018 Merge "rdbms: provide $owner argument in LoadBalancer::flushPrimarySessions()" 2022-03-15 18:32:53 +00:00
Umherirrender
e1900f228c tests: Remove unused mock of getLazyConnectionRef
Follow-Up: I82683596d644bb61a109e79dde6b0cb22c72b399
Change-Id: I20641dbfe6e3c98331c1a732781e761ceccc46f6
2022-03-15 19:08:12 +01:00
Aaron Schulz
ee3c65d541 rdbms: provide $owner argument in LoadBalancer::flushPrimarySessions()
This avoids DBUnexpectedError in LBFactory::flushPrimarySessions()

Follow-up: 4cac31de4e
Change-Id: I6b6e274135d842f379d71fb9efb42758984afc78
2022-03-15 10:42:21 -07:00
Alexander Vorwerk
71a092e513 Add 1.38 snapshot to sqlite db tests
Change-Id: I72e703473679dbe982c8d851a6c357b17de415eb
2022-03-15 17:05:42 +01:00
DannyS712
845094fe3d Language: retrieve MainConfig instead of using a bunch of globals
Change-Id: I791af9197a4a53723adf2869d7b3b9f41fe9c059
2022-03-15 02:58:42 +00:00
jenkins-bot
91f40bd829 Merge "tests: Add @group Broken to MediaWikiIntegrationTestCaseSchemaTest" 2022-03-15 01:50:00 +00:00
Clare Ming
47612020b5 Add option to amend robots meta tag
- Add private var, helper methods to format and set robots options.
- Add reference to new method in OutputPage::getHeadLinksArray().

Bug: T301584
Change-Id: I2652f20c9fe5f2d3e28e329d4eddc2a2ff88cf76
2022-03-14 23:03:41 +00:00
jenkins-bot
032e26d640 Merge "Call Maintenance::readconsole statically and fix documentation" 2022-03-14 22:02:34 +00:00
jenkins-bot
98f06217ff Merge "Fix error message in test assertion" 2022-03-14 21:53:42 +00:00
Umherirrender
bbcf9f7539 Call Maintenance::readconsole statically and fix documentation
Change-Id: Ib33ee8158ee62f8699241c55bd4f43599df9c80f
2022-03-14 21:15:35 +00:00
jenkins-bot
2cb99266de Merge "Create IP utilities for sanitizing and prettifying IPs via js" 2022-03-14 14:43:08 +00:00
jenkins-bot
df8ae68fd9 Merge "language: Fix order of arguments in truncateHtml()" 2022-03-13 21:59:20 +00:00
jenkins-bot
633177dbf0 Merge "Benchmark: Force string representation of arguments" 2022-03-12 02:07:21 +00:00
jenkins-bot
38f1c754ea Merge "mediawiki.Title: Remove broken commented-out test" 2022-03-12 01:43:05 +00:00
jenkins-bot
6fd4c95f5e Merge "Use updated ObjectFactory namespace" 2022-03-12 00:19:53 +00:00
Reedy
0285cf5c8f Benchmark: Force string representation of arguments
Output becomes:
`MediaWiki\Extension\TrustedXFF\TrustedXFF::onIsTrustedProxy('107.167.115.215', false)`

Rather than:

`MediaWiki\Extension\TrustedXFF\TrustedXFF::onIsTrustedProxy('107.167.115.215', )`

Change-Id: Id0139283ab15f0060c61425d89f76fed309855e2
2022-03-11 23:14:36 +00:00
jenkins-bot
f747241182 Merge "Remove &$references from $wgAutopromote in DefaultSettings" 2022-03-11 22:33:28 +00:00
daniel
1c7ffcd46a Integration test for extension registration
This adds full integration tests for extension registration, ensuring
that ExtensionProcessor and ExtensionRegistry work together as expected.

The existing tests for ExtensionProcessor and ExtensionRegistry are
converted to "pure" unit tests.

This change is intended to protect against bugs while refactoring
ExtensionProcessor and ExtensionRegistry to better integrate with the
new SettingsBuilder class.

Bug: T297166
Change-Id: I2d9cc373b8a4aa014aef93b0a8e8d83758851783
2022-03-11 21:43:41 +00:00
jenkins-bot
2d1734a291 Merge "MovePage: Propagate information about a new redirect using Status" 2022-03-11 21:40:11 +00:00
daniel
b0cbb9b8ba Remove &$references from $wgAutopromote in DefaultSettings
If we want to convert DefaultSettings to a schema, we can't use variable
references.

Change-Id: Ia53cf45f7f029e1ba4191324005fef25055d5296
2022-03-11 21:38:27 +00:00
tsepothoabala
63a952cf36 Create IP utilities for sanitizing and prettifying IPs via js
- Added repeatString,sanitizeIP and prettifyIP js functions
- Added repeatString,sanitizeIP and prettifyIP tests

Bug: T301174
Change-Id: I1edf2212540f2648b7993cd4a0e1e8df9830c7ee
2022-03-11 23:01:14 +02:00
jenkins-bot
a30468914d Merge "tests: Split out DatabaseSqliteUpgradeTest class" 2022-03-11 18:41:14 +00:00
Ammarpad
05b5fe76db mediawiki.Title: Remove broken commented-out test
This test cannot be reasonably fixed because of the way
String.prototype.lastIndexOf works; which is used under the hood for
the extension extraction and it has been disabled for a long time.

Change-Id: Ibc7f5e09cd12e72bb9558d8619e93146a95a455e
2022-03-11 18:12:31 +00:00
jenkins-bot
ccd9788774 Merge "Set page id to 0 for pages in virtual namespaces" 2022-03-11 09:21:57 +00:00
Aaron Schulz
277d34818b tests: Split out DatabaseSqliteUpgradeTest class
The testUpgrades() method is slow and is easier to
parallelize via paratest if it lies in a separate class/file

Also make the test use a data provider

Bug: T50217
Change-Id: I5c8df6ae0ff34941f4cf7275680b309e79565925
2022-03-10 23:29:29 -08:00
jenkins-bot
801428d347 Merge "Tests: expected value goes first in PHPUnit assertions" 2022-03-10 20:55:22 +00:00
Umherirrender
37ef5c0cfe tests: Add @group Broken to MediaWikiIntegrationTestCaseSchemaTest
Bug: T292239
Change-Id: I7061f5e630858443e9127c3267069ae6bba192e2
2022-03-10 21:30:54 +01:00
Nikki Nikkhoui
f6780de058 Set page id to 0 for pages in virtual namespaces
If we are creating a Mock title, the ID should be set to 0
for any Titles that are in "virtual" namespaces (e.g.
any with a namespace ID < 0, which is Special: or
Media:)

Change-Id: I6aae00ae8f68ad3a93d9edd1194e828735e2a878
2022-03-10 20:12:27 +00:00