Vedmaka added a comment.

  In T224607#5222255 <https://phabricator.wikimedia.org/T224607#5222255>, 
@Umherirrender wrote:
  
  > MediaWikiTestCase::setGroupPermissions should override the services, not 
each extension calling that function or at least mention the fact, that it is 
needed.
  
  
  I believe there are a couple of issues with just adding services override 
into `MediaWikiTestCase::setGroupPermissions` :
  
  - In some cases groups permissions in tests being changed via globals - 
directly or via `setMwGlobals` calls and not via `setGroupPermissions`, for 
example:
    - 
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/AbuseFilter/+/509165/5/tests/phpunit/AbuseFilterTest.php#94
    - 
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/509619/7/repo/tests/phpunit/includes/Actions/EditEntityActionTest.php#922
    - https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/509619
  - Some tests override services individually so `overrideMwServices` call is 
prohibited (at the moment). eg:
    - 
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase/+/refs/heads/master/repo/tests/phpunit/includes/Api/WikibaseApiTestCase.php#34
  
  So it looks like we either need to change the logic around 
`overrideMwServices`/`setService` or we could try to reset `PermissionManger` 
only via `MediaWikiServices::resetServiceForTesting`, though this would solve 
only the second problem and not the first.

TASK DETAIL
  https://phabricator.wikimedia.org/T224607

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: kostajh, Vedmaka
Cc: nray, Umherirrender, Vedmaka, daniel, Krinkle, Liuxinyu970226, kostajh, 
E.S.A-Sheild, darthmon_wmde, Premeditated, joker88john, DannyS712, CucyNoiD, 
Nandana, NebulousIris, Mringgaard, Gaboe420, Versusxo, Majesticalreaper22, 
Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Baloch007, Darkminds3113, 
Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, 
QZanden, LawExplorer, WSH1906, Lewizho99, Maathavan, _jensen, rosalieper, 
Wong128hk, Wikidata-bugs, Snowolf, aude, Darkdadaah, Jdforrester-WMF, Mbch331, 
Rxy, Jay8g, Krenair, Legoktm
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to