kostajh added a comment.
In T310255#7991592 <https://phabricator.wikimedia.org/T310255#7991592>, @Lucas_Werkmeister_WMDE wrote: > Okay, CentralAuth sets up its database in `UnitTestsHookHandler::onUnitTestsAfterDatabaseSetup()`, but that hook is only run by `MediaWikiIntegrationTestCase::setupTestDB()`. `ApiFormatReferenceTest` and `QuerySearchEntitiesTest` are nominally unit tests, not integration tests, so the database doesn’t get set up, but then CentralAuth still runs as if it’s in an integration test. > > I think the correct solution here is to declare those tests as integration tests. +1, that makes sense to me. As for the general problem about separate unit/integration runs, `composer phpunit:unit` runs which uses a fairly restrictive bootstrap file. Any attempts to access the database there or MediaWiki services would fail, for example. That command looks for tests that are in the `tests/phpunit/unit` subdirectory. So, we need to update Quibble's PHPUnit commands to then ensure that `tests/phpunit/unit` is excluded from integration test runs. We could do that by applying `@group Unit` to each unit test class and then using `--exclude Unit` in Quibble. That's a lot of work, though. We could also have ExtensionTestSuite manually exclude any tests that are in `tests/phpunit/unit` subdirectory, but that wouldn't handle the test run that happens for core. Maybe it is most straightforward (but also another hack) to just remove the `tests/phpunit/unit` directory from each project after `composer phpunit:unit` runs. TASK DETAIL https://phabricator.wikimedia.org/T310255 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: kostajh Cc: Jakob_WMDE, Lucas_Werkmeister_WMDE, kostajh, Krinkle, Aklapper, Physikerwelt, Fernandobacasegua34, Astuthiodit_1, 786, Suran38, Biggs657, karapayneWMDE, Invadibot, Lalamarie69, Zabe, maantietaja, Juan90264, Alter-paule, Beast1978, ItamarWMDE, Un1tY, Akuckartz, Hook696, CptViraj, Majavah, Kent7301, joker88john, DannyS712, wildly_boy, CucyNoiD, Nandana, Gaboe420, lucamauri, Giuliamocci, Cpaulf30, Lahi, Gq86, Af420, Bsandipan, GoranSMilovanovic, Maosef, QZanden, LawExplorer, Lewizho99, Maathavan, Debenben, _jensen, rosalieper, Neuronton, Scott_WUaS, Izno, Wong128hk, thcipriani, Wikidata-bugs, Snowolf, aude, fredw, Pkra, scfc, Jdforrester-WMF, Mbch331, Jay8g, hashar
_______________________________________________ Wikidata-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected]
