Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the Behat timeout factor to be configured #295

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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
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