Skip to content

Commit 700edd9

Browse files
committed
Let MW-Selenium 1.x use the local test suite configuration
MW-Selenium 1.x simplified the configuration of various environments by reading in a locally defined `environments.yml` file. Anything defined by environment variables, however, will override these defaults. We should respect the local YAML configuration if it exists by not defining environment variables for MW URLs and the MW user. Change-Id: I2d0f83d0c6a406d46627578cb8db0706d1b8655d
1 parent 97b528e commit 700edd9

1 file changed

Lines changed: 25 additions & 6 deletions

File tree

jjb/macro-browsertests.yaml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
fi
1010
export CUCUMBER_TAGS={cucumber_tags}
1111
export HEADLESS={headless}
12-
export MEDIAWIKI_API_URL=http://{mediawiki_url}/w/api.php
13-
export MEDIAWIKI_URL=http://{mediawiki_url}/wiki/
12+
1413
export PLATFORM='{platform}'
1514
# Replace PLATFORM underscores (Jenkins) to spaces (SauceLabs)
1615
export PLATFORM=${{PLATFORM//_/ }}
16+
1717
export SCREENSHOT_FAILURES=true
1818
export SCREENSHOT_FAILURES_PATH="$WORKSPACE/log"
1919
2020
# Log results to Raita
2121
export RAITA_URL=http://integration-raita.eqiad.wmflabs:9200/raita
2222
23-
# Set MEDIAWIKI_ENVIRONMENT for mediawiki-selenium >= 1.0.0
23+
# Set MEDIAWIKI_ENVIRONMENT for mw-selenium 1.x
2424
case '{mediawiki_url}' in
2525
*.beta.wmflabs.org)
2626
export MEDIAWIKI_ENVIRONMENT=beta
@@ -31,15 +31,34 @@
3131
esac
3232
3333
set +x
34+
3435
if [ -z $MEDIAWIKI_CREDENTIALS ]; then
3536
echo "\$MEDIAWIKI_CREDENTIALS is empty. Check job configuration."
3637
exit 1
3738
fi
38-
export MEDIAWIKI_USER=`echo $MEDIAWIKI_CREDENTIALS | cut -f1 -d:`
39-
export MEDIAWIKI_PASSWORD=`echo $MEDIAWIKI_CREDENTIALS | cut -f2- -d:`
40-
export MEDIAWIKI_PASSWORD_VARIABLE='MEDIAWIKI_PASSWORD'
39+
40+
MEDIAWIKI_USER=`echo $MEDIAWIKI_CREDENTIALS | cut -f1 -d:`
41+
MEDIAWIKI_PASSWORD=`echo $MEDIAWIKI_CREDENTIALS | cut -f2- -d:`
42+
4143
set -x
4244
45+
MEDIAWIKI_API_URL=http://{mediawiki_url}/w/api.php
46+
MEDIAWIKI_URL=http://{mediawiki_url}/wiki/
47+
48+
# Let test suites running mw-selenium 1.x use their own
49+
# configuration for URLs and users, but export our settings for
50+
# versions 0.x
51+
if [ ! -f "{folder}/browser/environments.yml" ]; then
52+
export MEDIAWIKI_API_URL
53+
export MEDIAWIKI_URL
54+
export MEDIAWIKI_USER
55+
fi
56+
57+
# Export the MW user password regardless, as passwords are not kept
58+
# in test suite configurations
59+
export MEDIAWIKI_PASSWORD
60+
61+
4362
# VERSION is used for SauceLabs
4463
export VERSION={version}
4564

0 commit comments

Comments
 (0)