Page MenuHomePhabricator

Make MediaWiki-Docker as the default for Selenium framework
Closed, DuplicatePublic

Description

Status

1/29 repositories (3%)

Notes

At the moment, mediawiki-vagrant is the default. We want to make mediawiki-docker the default.

mediawiki-docker uses .env file:

MW_SCRIPT_PATH=/w
MW_SERVER=http://localhost:8080
MEDIAWIKI_USER=Admin
MEDIAWIKI_PASSWORD=dockerpass

Instead of using hard-coded values in wdio.conf.js, use valuse from .env file.

wdio.conf.js

mwUser: process.env.MEDIAWIKI_USER || 'Admin',
mwPwd: process.env.MEDIAWIKI_PASSWORD || 'vagrant',
...
baseUrl: ( process.env.MW_SERVER || 'http://127.0.0.1:8080' ) + (process.env.MW_SCRIPT_PATH || '/w'

Check if we're already using an NPM package for parsing .env files. If yes, use it. If no, find one. (Example: dotenv.) Replace values for above environment variables with the ones from .env.

Instructions

Refer https://www.mediawiki.org/wiki/Selenium/Getting_Started/Run_tests_targeting_MediaWiki-Docker

Repositories

  • mediawiki/core 643576
  • mediawiki/extensions/AbuseFilter 644303
  • mediawiki/extensions/AdvancedSearch 644314
  • mediawiki/extensions/CirrusSearch
  • mediawiki/extensions/Cite
  • mediawiki/extensions/CodeMirror
  • mediawiki/extensions/Echo
  • mediawiki/extensions/ElectronPdfService
  • mediawiki/extensions/EntitySchema
  • mediawiki/extensions/FileImporter
  • mediawiki/extensions/GrowthExperiments
  • mediawiki/extensions/Math
  • mediawiki/extensions/MobileFrontend
  • mediawiki/extensions/Newsletter
  • mediawiki/extensions/Popups
  • mediawiki/extensions/ProofreadPage
  • mediawiki/extensions/RelatedArticles
  • mediawiki/extensions/RevisionSlider
  • mediawiki/extensions/TemplateWizard
  • mediawiki/extensions/TwoColConflict
  • mediawiki/extensions/Wikibase
  • mediawiki/extensions/WikibaseLexeme
  • mediawiki/extensions/WikibaseMediaInfo
  • mediawiki/skins/MinervaNeue
  • phabricator/deployment
  • wikibase/termbox
  • wikidata/query/gui
  • wikimedia/portals/deploy
  • wmde/wdio-wikibase

TODO

Event Timeline

It might be nice to add a bit of extra logic somewhere in this stack to make this automatically discoverable and configured no matter which one of the commons dev environments you use, rather than switching from one hard coding to another.

Change 643576 had a related patch set uploaded (by Harriet Ayugi; owner: Harriet Ayugi):
[mediawiki/core@master] Change the values of some environment variables in wdio.conf.js file

https://gerrit.wikimedia.org/r/643576

It might be nice to add a bit of extra logic somewhere in this stack to make this automatically discoverable and configured no matter which one of the commons dev environments you use, rather than switching from one hard coding to another.

@Addshore I am not sure I understand what you meant but the suggestion seems interesting. Can you explain a bit more here?

This task and its patch shouldn't be needed. MediaWiki-Docker instructs you to write a .env file with

export MW_SERVER=http://localhost:8080
export MW_SCRIPT_PATH=/
export MEDIAWIKI_USER=Admin
export MEDIAWIKI_PASSWORD=dockerpass

wdio.conf.js should read from that, and if those env variables aren't set then it falls back to settings relevant to Vagrant.

(Side note: as of a month or two ago, MW_SCRIPT_PATH should be /w for MediaWiki-Docker, just like it is for Vagrant)

Thanks @kostajh, that's a great idea! I've updated the task description.

Change 644303 had a related patch set uploaded (by Harriet Ayugi; owner: Harriet Ayugi):
[mediawiki/extensions/AbuseFilter@master] Selenium: Target Mediawiki-Docker by default

https://gerrit.wikimedia.org/r/644303

Change 644314 had a related patch set uploaded (by Harriet Ayugi; owner: Harriet Ayugi):
[mediawiki/extensions/AdvancedSearch@master] Selenium: Target Mediawiki-Docker by default

https://gerrit.wikimedia.org/r/644314

Change 644314 had a related patch set uploaded (by Harriet Ayugi; owner: Harriet Ayugi):
[mediawiki/extensions/AdvancedSearch@master] Selenium: Target Mediawiki-Docker by default

https://gerrit.wikimedia.org/r/644314

Hej @Harriet sorry to stop you here, but as I understood the last comment by @kostajh, this task is _not_ about changing the default/fallback in the wdio.conf from using the Vagrant settings.

wdio.conf.js should read from that, and if those env variables aren't set then it falls back to settings relevant to Vagrant.

Change 644314 had a related patch set uploaded (by Harriet Ayugi; owner: Harriet Ayugi):
[mediawiki/extensions/AdvancedSearch@master] Selenium: Target Mediawiki-Docker by default

https://gerrit.wikimedia.org/r/644314

Hej @Harriet sorry to stop you here, but as I understood the last comment by @kostajh, this task is _not_ about changing the default/fallback in the wdio.conf from using the Vagrant settings.

wdio.conf.js should read from that, and if those env variables aren't set then it falls back to settings relevant to Vagrant.

@WMDE-Fisch Since we officially support Mediaiwiki-Docker, the aim here is to fallback to Mediawiki-Docker by default instead of Mediawiki-Vagrant

Change 644314 had a related patch set uploaded (by Harriet Ayugi; owner: Harriet Ayugi):
[mediawiki/extensions/AdvancedSearch@master] Selenium: Target Mediawiki-Docker by default

https://gerrit.wikimedia.org/r/644314

Hej @Harriet sorry to stop you here, but as I understood the last comment by @kostajh, this task is _not_ about changing the default/fallback in the wdio.conf from using the Vagrant settings.

wdio.conf.js should read from that, and if those env variables aren't set then it falls back to settings relevant to Vagrant.

@WMDE-Fisch Since we officially support Mediaiwiki-Docker, the aim here is to fallback to Mediawiki-Docker by default instead of Mediawiki-Vagrant

Thanks for the clarification! Then I guess that the task should be updated to reflect that. :-)

Soham renamed this task from MediaWiki-Docker is the default for Selenium framework to Make MediaWiki-Docker as the default for Selenium framework.Dec 1 2020, 10:39 AM

@WMDE-Fisch thanks for pointing it out. I've changed the task title

Change 643576 merged by jenkins-bot:
[mediawiki/core@master] Selenium: Target Mediawiki-Docker by default

https://gerrit.wikimedia.org/r/643576

It might be nice to add a bit of extra logic somewhere in this stack to make this automatically discoverable and configured no matter which one of the commons dev environments you use, rather than switching from one hard coding to another.

That's what we did at the end, the framework reads .env file.

zeljkofilipin added a subscriber: Harriet.
brennen moved this task from Backlog to Radar on the User-brennen board.
brennen subscribed.
zeljkofilipin moved this task from Radar to Doing on the User-brennen board.
zeljkofilipin moved this task from Doing to Radar on the User-brennen board.
zeljkofilipin moved this task from Waiting 🏹 to Deep work 🌊 on the User-zeljkofilipin board.

Change 644303 abandoned by Zfilipin:

[mediawiki/extensions/AbuseFilter@master] Selenium: Target Mediawiki-Docker by default

Reason:

Replaced by T281484.

https://gerrit.wikimedia.org/r/644303

Change 644314 abandoned by Zfilipin:

[mediawiki/extensions/AdvancedSearch@master] Selenium: Target Mediawiki-Docker by default

Reason:

Replaced by T281484.

https://gerrit.wikimedia.org/r/644314