Page MenuHomePhabricator

Need a mechanism for injecting a LocalSettings.php fragment before nodejs browser tests
Open, Needs TriagePublic

Description

The Ruby browser test running script has this enviable clause, https://phabricator.wikimedia.org/source/integration-config/browse/master/dockerfiles/quibble-stretch-bundle/mwselenium.sh$35-39

I want the same thing for selenium tests, so that MediaWiki configuration can be added before my test. In this specific case, for T190829 I want to add:

$wgEnableUploads = true;

Actually, the mwselenium.sh wouldn't quite work in our case, since the test is being run from mw-core so the base_dir is irrelevant to the extension repo where we need to adjust the LocalSettings.php. For the same reason, I'm not seeing an easy workaround where I inject settings from an extension script. If anything, I need to do this injection from the test case itself, which feels very wrong.

Event Timeline

awight created this task.May 16 2019, 10:06 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 16 2019, 10:06 AM

Looks like the biggest blocker is T199116: Quibble should run `npm install` and `npm run selenium-test` for each extension/skin that has Selenium tests, because:

mwselenium.sh wouldn't quite work in our case, since the test is being run from mw-core

It would be nice to package the PHP fragments in a conf.d-style directory, which gets cleaned and repopulated between browser tests on each repo, to reduce the chance of interference between tests.