Page MenuHomePhabricator

Allow tests to specify what extensions and or what order things are loaded in
Closed, InvalidPublic

Description

The remaining issue is that the Wikidata.php entry file is loaded before we can define some vars in php, thus the repo / client is not loaded hence Lib is not loaded and we get the exception about undefined constant.
The wikidata.php file is loaded by the 50_mw_ext_loader.php file.

As far as I can tell the best ways to deal with this would be to:

Allow tests to specify what they want to be added to localsettings, this would probably require far to much repetition in regard to extension tests, although would mean we can test extensions that have badly named entry points.

Allow tests to specify specific things to add to localsettings but if this is not defined then fallback to the autoloading of entry points (seems like quite a good plan)

Allow tests to skip the autoloading of extensions from 50_mw_ext_loader.php

Allow tests to skip any defined conf.d file by adding it to some sort of ignore array prior to them all loading


Version: wmf-deployment
Severity: enhancement

Details

Reference
bz70250

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:41 AM
bzimport set Reference to bz70250.
bzimport added a subscriber: Unknown Object (MLST).

I see a lot of proposals for implementation but no specific use cases or issues it would solve.

Would the following not work?

  • Include extension in LocalSettings.php.
  • Run phpunit tests.

Tests set wg-config variables in their PHPUnit test setUp method. And it either doesn't depend on other classes, or takes the instance as passed parameter from during the test.

Please provide specific cases where this doesn't work.

Krinkle added a project: Wikidata.
Krinkle removed a subscriber: Unknown Object (MLST).

So I have no idea what triggered this ticket in 2014 (thanks past self for linking to things......)

I unless anyone has any other ideas I'll mark this as Invalid for now.
I suspect lots of the above is probably also out of date now.