Skip to content

Commit

Permalink
Allow the Behat timeout factor to be configured
Browse files Browse the repository at this point in the history
  • Loading branch information
NeillM committed Jul 1, 2024
1 parent ffb971f commit 7ae258d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions bin/moodle-docker-compose
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,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
Expand Down
3 changes: 3 additions & 0 deletions bin/moodle-docker-compose.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions config.docker-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
),
);
$CFG->behat_faildump_path = '/var/www/behatfaildumps';
$CFG->behat_increasetimeout = getenv('MOODLE_DOCKER_TIMEOUT_FACTOR');

define('PHPUNIT_LONGTEST', true);

Expand Down

0 comments on commit 7ae258d

Please sign in to comment.