Page MenuHomePhabricator

Failed loading configuration file: /src/tests/selenium/wdio.conf.js: MW_SERVER or MW_SCRIPT_PATH not defined.
Closed, ResolvedPublic

Description

Example output.

+ npm run-script selenium-daily

> selenium-daily
> npm run @selenium-test

> @selenium-test
> wdio tests/selenium/wdio.conf.js

2021-06-09T23:10:31.847Z DEBUG @wdio/config:utils: Couldn't find ts-node package, no TypeScript compiling
2021-06-09T23:10:31.851Z ERROR @wdio/config:ConfigParser: Failed loading configuration file: /src/tests/selenium/wdio.conf.js: MW_SERVER or MW_SCRIPT_PATH not defined.
See https://www.mediawiki.org/wiki/Selenium/How-to/Set_environment_variables

It is caused by T283597: Update wdio-mediawiki to 1.1.1 in all repositories.

Relevant code from tests/selenium/wdio-mediawiki/wdio-defaults.conf.js.

if ( !process.env.MW_SERVER || !process.env.MW_SCRIPT_PATH ) {
	throw new Error( 'MW_SERVER or MW_SCRIPT_PATH not defined.\nSee https://www.mediawiki.org/wiki/Selenium/How-to/Set_environment_variables\n' );
}

Failing jobs:

The updated webdriverio configuration no longer has MW_SCRIPT_PATH environment variable hard-coded. That is causing the failures. I've added the variable to Jenkins jobs in 699244.

Event Timeline

Change 699019 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/MinervaNeue@master] Revert "selenium: Update wdio-mediawiki"

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

zeljkofilipin renamed this task from Minerva tests are failing due to undefined globals to Failed loading configuration file: /src/tests/selenium/wdio.conf.js: MW_SERVER or MW_SCRIPT_PATH not defined..Jun 10 2021, 10:51 AM
zeljkofilipin moved this task from Inbox to Selenium on the MediaWiki-Core-Tests board.
zeljkofilipin updated the task description. (Show Details)

Change 699240 had a related patch set uploaded (by Zfilipin; author: Zfilipin):

[mediawiki/extensions/CentralNotice@master] WIP selenium: Fix selenium-daily-beta-CentralNotice

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

Change 699244 had a related patch set uploaded (by Zfilipin; author: Zfilipin):

[integration/config@master] WIP selenium: Fix `Failed loading configuration file`

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

Change 699019 abandoned by Jdlrobson:

[mediawiki/skins/MinervaNeue@master] Revert "selenium: Update wdio-mediawiki"

Reason:

This didn't unblock https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/ /698651 so happy to abandon.

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

Change 699240 abandoned by Zfilipin:

[mediawiki/extensions/CentralNotice@master] WIP selenium: Fix selenium-daily-beta-CentralNotice

Reason:

Implemented in https://gerrit.wikimedia.org/r/c/integration/config/ /699244

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

The updated webdriverio configuration no longer has MW_SCRIPT_PATH environment variable hard-coded. That is causing the failures. I've added the variable to Jenkins jobs in 699244.

IMO it would make sense to set a default fallback to /w as that's used in MediaWiki-Docker, MediaWiki-Vagrant, beta cluster, production, etc. So only MW_SERVER would be required, and if MW_SCRIPT_PATH isn't set then we use a default of /w.

IMO it would make sense to set a default fallback to /w as that's used in MediaWiki-Docker, MediaWiki-Vagrant, beta cluster, production, etc. So only MW_SERVER would be required, and if MW_SCRIPT_PATH isn't set then we use a default of /w.

That's a discussion I had with @Krinkle in 683898 (and possibly somewhere in IRC too) and we decided to require both variables to be set. I'm open to using a default for MW_SCRIPT_PATH. Feel free to send a patch. Relevant code is in the task description.

Change 699244 merged by jenkins-bot:

[integration/config@master] jjb: Fix failing selenium-daily-* Jenkins jobs

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

zeljkofilipin claimed this task.