Page MenuHomePhabricator

Ensure quickstart provisions a working wikilambda
Closed, ResolvedPublic

Description

Building on the already existing work with mediawiki-quickstart, create a local instance of Wikilambda that could be spun up using this mediawiki-quickstart as well.

A couple of helpful guides:
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikiLambda/+/refs/heads/master/README.md#development-instructions
https://meta.wikimedia.org/wiki/Abstract_Wikipedia/Abstract_developer_cheatsheet

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Adding override to handle ancestor strategy selenium test failures for WikiLambda.repos/test-platform/mediawiki-quickstart!53ebomaniT380409main
Adding docker-compose to enable WikiLambda and WikiEditor dependency.repos/test-platform/mediawiki-quickstart!42ebomaniT380409main
Customize query in GitLab

Event Timeline

Do we want to encourage people to use that framework? All our documentation is about the proper MediaWiki Docker system instead.

If it could work with the services then I think it would be a great option for onboarding to Wikilambda. For other extensions, mediawiki-quickstart has made it incredibly easy to get those envs spun up. This may not be the case with Wikilambda because of the services, but this ticket is just for the test platform team to be able to create the instance. As far as encouraging people to use that framework, if it does turn out to be able to make it as straightforward to install as it has other with extensions, then I think it would create a more standardized local setup across machines.

SDunlap renamed this task from Create mediawiki-quickstart for Wikilambda to Ensure quickstart provisions a working wikilambda.Jan 13 2025, 8:40 PM
SDunlap edited projects, added Test Platform (The First One 1); removed Test Platform.

We might be able to spin up the services by adding containers for the evaluator and orchestractor to the docker-compose override

To test the current WikiLambda installation:

VERBOSE=1 ./fresh_install
VERBOSE=1 ./install extensions/WikiLambda

( installs/starts Mediawiki, then installs WikiLambda and its dependencies )

Relevant WikiLambda files are here:

https://gitlab.wikimedia.org/repos/test-platform/mediawiki-quickstart/-/tree/main/extensions/WikiLambda?ref_type=heads

@Jdforrester-WMF mediawiki-quickstart is currently being developed, but we would like it to eventually become the tool of choice for developers and testers. One thing nice about it, is it codifies the provisioning per module (skin or extension) (e.g. for wikilambda it adds the user/roles and performs the necessary maintenance scripts,) so the documentation becomes executable code in a sense.

This facilitates provisioning of extensions which depend on additional docker containers being spun up:

Enable component-level docker-compose.yml files

Nice progress! Some tests are still failing: P70991.

Nice progress! Some tests are still failing: P70991.

Current status:

  • Quickstart installs WikiLambda
  • Test partially run

Next to do:

  • get all tests running
  • make it easy

tl;dr: get it working, make it easy.

Problem (roughly)

Quickstart ignores wdio.conf.js that lives with extensions and skins and instead only uses the version in the wdio-mediawiki npm package. In the vast majority of repositories this file is empty BUT a few repos (like WikiLambda) has wdio.conf.js overrides that is missing in this local test run.

run_selenium_tests loads its own wdio.conf.override.js where it loads the root wdio.conf.js file but NOT the extension-specific wdio.conf.js.

Next steps: @EBomani and @zeljkofilipin will pair up to get it working and talk about how this might work.

Spoke with @vaughnwalters and from that, we found that the only fix on the Quickstart side of things relating to WikiLambda needs to be the override and the rest of the test failures are not related to our change. Through @zeljkofilipin, @Mhurd and I's conversation, the following override was implemented:

before() {
		browser.addLocatorStrategy( 'ancestor', ( selector, root ) => {
			const result = root && root.closest( selector );
			return result ? [ result ] : [];
		} );
	}

With it added, all ancestor strategy related failures were eliminated. The selenium tests are currently running as expected. Interestingly enough, when testing I found that for some reason even without the override selenium tests ran locally do not contain the issue relating to ancestor strategy this time around. It's much better to make it airtight, though, so I propose adding the override in the meantime and then working on a larger solution that will take to account each extension or skin's specific settings provided in the wdio.conf.js in its directory.

  • get all tests running
  • make it easy

All in all, with regards to having Quickstart successfully provision a WikiLambda, that objective has successfully been met. 🎉

Met with @Mhurd and using ./run_component_selenium_tests script removes the need for the override since the script will source the appropriate wdio.conf.js from the component's own directory, this task is complete.

P.S.: For the curious minds, the reason it seemed to be working without the override was because once wdio.conf.override.js changes were picked up, they persisted and the only way to 'reset' it would be a fresh install of Quickstart, which I had not done. After doing the fresh install and testing once more, it behaved as expected.

mhurd closed https://gitlab.wikimedia.org/repos/test-platform/mediawiki-quickstart/-/merge_requests/53

Adding override to handle ancestor strategy selenium test failures for WikiLambda.