Skip to content

Commit 0561af9

Browse files
committed
Use selenium-firefox docker image version 2.53.1
Also remove PROFILE env var in .travis.yml to prevent assumption that changing its value to `firefox` will work (it won't if version remain 3). Also add moodle dir mount to selenium container to allow running file upload tests.
1 parent 0b2090b commit 0561af9

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

.travis.dist.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ before_install:
3232
- cd ../..
3333
- composer create-project -n --no-dev --prefer-dist blackboard-open-source/moodle-plugin-ci ci ^2
3434
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
35-
- docker run -d -p 127.0.0.1:4444:4444 --net=host -v /dev/shm:/dev/shm selenium/standalone-firefox:3
3635

3736
install:
3837
- moodle-plugin-ci install
38+
- docker run -d -p 127.0.0.1:4444:4444 --net=host -v /dev/shm:/dev/shm -v $HOME/build/moodle:$HOME/build/moodle selenium/standalone-firefox:2.53.1
39+
- sleep 10
3940

4041
script:
4142
- moodle-plugin-ci phplint

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,21 @@ env:
2323
- MUSTACHE_IGNORE_NAMES=broken.mustache
2424
- DB=pgsql
2525
- MOODLE_BRANCH=master
26-
- PROFILE=chrome
2726

2827
install:
2928
- phpenv config-rm xdebug.ini
3029
- nvm install 8.9
3130
- nvm use 8.9
3231
- make init
33-
# Start Selenium Standalone with Chrome/Firefox installed.
34-
- docker run -d -p 127.0.0.1:4444:4444 --net=host -v /dev/shm:/dev/shm selenium/standalone-${PROFILE}:3
3532
# Mimic how a Moodle plugin would be run.
3633
- cp -R tests/Fixture/moodle-local_travis ../moodle-local_travis
3734
- export PATH="$(cd bin; pwd):$(cd vendor/bin; pwd):$PATH"
3835
- export TRAVIS_BUILD_DIR=$(cd ../moodle-local_travis; pwd)
39-
4036
# Finally, the standard install step.
4137
- moodle-plugin-ci install
38+
# Start Selenium Standalone with Chrome.
39+
- docker run -d -p 127.0.0.1:4444:4444 --net=host -v /dev/shm:/dev/shm -v $HOME/build/moodle:$HOME/build/moodle selenium/standalone-chrome:3
40+
- sleep 10
4241

4342
script:
4443
- make test-phpunit
@@ -54,7 +53,7 @@ script:
5453
- moodle-plugin-ci grunt || [ "$MOODLE_BRANCH" != 'master' -a "$MOODLE_BRANCH" != 'MOODLE_38_STABLE' ]
5554
- moodle-plugin-ci phpdoc
5655
- moodle-plugin-ci phpunit --coverage-text
57-
- moodle-plugin-ci behat --profile $PROFILE
56+
- moodle-plugin-ci behat --profile chrome
5857

5958
jobs:
6059
include:

docs/TravisFileExplained.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ before_install:
6666
- composer create-project -n --no-dev --prefer-dist blackboard-open-source/moodle-plugin-ci ci ^2
6767
# Update the $PATH so scripts from this project can be called easily.
6868
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
69-
# Start Selenium Standalone server with Chrome/Firefox installed. If you
70-
# prefer to run Behat tests with Chrome profile (see Behat step details below),
71-
# use selenium/standalone-chrome:3 image instead.
72-
- docker run -d -p 127.0.0.1:4444:4444 --net=host -v /dev/shm:/dev/shm selenium/standalone-firefox:3
7369

7470
# This lists steps that are run for installation and setup.
7571
install:
@@ -84,6 +80,15 @@ install:
8480
# - If your plugin has Behat features, then Behat will be setup.
8581
# - If your plugin has unit tests, then PHPUnit will be setup.
8682
- moodle-plugin-ci install
83+
# Start Selenium Standalone server with Chrome/Firefox installed. If you
84+
# prefer to run Behat tests with Chrome profile (see Behat step details below),
85+
# use selenium/standalone-chrome:3 image instead. If you don't run Behat tests,
86+
# this step is not needed.
87+
- docker run -d -p 127.0.0.1:4444:4444 --net=host -v /dev/shm:/dev/shm -v $HOME/build/moodle:$HOME/build/moodle selenium/standalone-firefox:2.53.1
88+
# Optional sleep interval, this is important if you run Behat tests as the first
89+
# step after docker instance creation - in some cases Selenium server might
90+
# not be ready yet, which will result in failure.
91+
- sleep 10
8792

8893
# This lists steps that are run for the purposes of testing. Any of
8994
# these steps can be re-ordered or removed to your liking. And of

0 commit comments

Comments
 (0)