From 90c02887d077b752790b570c57e1354b7c475b35 Mon Sep 17 00:00:00 2001 From: Neill Magill Date: Mon, 11 Nov 2019 09:20:24 +0000 Subject: [PATCH] Allow the Behat timeout factor to be configured --- README.md | 1 + base.yml | 1 + bin/moodle-docker-compose | 2 ++ bin/moodle-docker-compose.cmd | 3 +++ config.docker-template.php | 1 + 5 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 295f7ece..cdab2cfa 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,7 @@ When you change them, use `bin/moodle-docker-compose down && bin/moodle-docker-c | `MOODLE_DOCKER_SELENIUM_VNC_PORT` | no | any integer value (or bind_ip:integer)| not set | If set, the selenium node will expose a vnc session on the port specified. Similar to MOODLE_DOCKER_WEB_PORT, you can optionally define the host IP to bind to. If you just set the port, VNC binds to 127.0.0.1 | | `MOODLE_DOCKER_APP_PATH` | no | path on your file system | not set | If set and the chrome browser is selected, it will start an instance of the Moodle app from your local codebase | | `MOODLE_DOCKER_APP_VERSION` | no | a valid [app docker image version](https://docs.moodle.org/dev/Moodle_App_Docker_images) | not set | If set will start an instance of the Moodle app if the chrome browser is selected | +| `MOODLE_DOCKER_TIMEOUT_FACTOR` | no | any integer value | 1 | If set the timeouts in behat will be multiplied by the factor | In addition to that, `MOODLE_DOCKER_RUNNING=1` env variable is defined and available in the webserver container to flag being run by `moodle-docker`. Developer diff --git a/base.yml b/base.yml index 2ce15ba0..a20f3620 100644 --- a/base.yml +++ b/base.yml @@ -13,6 +13,7 @@ services: MOODLE_DOCKER_DBPASS: "m@0dl3ing" MOODLE_DOCKER_BROWSER: firefox MOODLE_DOCKER_WEB_HOST: "${MOODLE_DOCKER_WEB_HOST}" + MOODLE_DOCKER_TIMEOUT_FACTOR: "${MOODLE_DOCKER_TIMEOUT_FACTOR}" exttests: image: moodlehq/moodle-exttests volumes: diff --git a/bin/moodle-docker-compose b/bin/moodle-docker-compose index 72950a8a..473b06cd 100755 --- a/bin/moodle-docker-compose +++ b/bin/moodle-docker-compose @@ -229,6 +229,8 @@ then dockercompose="${dockercompose} -f ${basedir}/webserver.port.yml" fi +# Behat test timeout factor +export MOODLE_DOCKER_TIMEOUT_FACTOR=${MOODLE_DOCKER_TIMEOUT_FACTOR:-1} # Mac OS Compatbility if [[ "$(uname)" == "Darwin" ]]; then diff --git a/bin/moodle-docker-compose.cmd b/bin/moodle-docker-compose.cmd index 7754c6af..a51c4975 100644 --- a/bin/moodle-docker-compose.cmd +++ b/bin/moodle-docker-compose.cmd @@ -185,6 +185,9 @@ IF "%MOODLE_DOCKER_SELENIUM_VNC_PORT%"=="" ( ) ) +IF "%MOODLE_DOCKER_TIMEOUT_FACTOR%"=="" ( + SET MOODLE_DOCKER_TIMEOUT_FACTOR=1 +) REM Apply local customisations if a local.yml is found. REM Note: This must be the final modification before the docker-compose command is called. diff --git a/config.docker-template.php b/config.docker-template.php index ebed286f..78d6d8cd 100644 --- a/config.docker-template.php +++ b/config.docker-template.php @@ -80,6 +80,7 @@ ), ); $CFG->behat_faildump_path = '/var/www/behatfaildumps'; +$CFG->behat_increasetimeout = getenv('MOODLE_DOCKER_TIMEOUT_FACTOR'); define('PHPUNIT_LONGTEST', true);