You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+76Lines changed: 76 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -87,6 +87,7 @@ Notes:
87
87
* The behat faildump directory is exposed at http://localhost:8000/_/faildumps/.
88
88
* Use `MOODLE_DOCKER_BROWSER` to switch the browser you want to run the test against.
89
89
You need to recreate your containers using `bin/moodle-docker-compose` as described below, if you change it.
90
+
* Check the [Custom commands](#custom-commands) section for more options.
90
91
91
92
## Use containers for running phpunit tests
92
93
@@ -110,6 +111,7 @@ OK (2 tests, 7 assertions)
110
111
111
112
Notes:
112
113
* If you want to run test with coverage report, use command: `bin/moodle-docker-compose exec webserver phpdbg -qrr vendor/bin/phpunit --coverage-text auth_manual_testcase auth/manual/tests/manual_test.php`
114
+
* Check the [Custom commands](#custom-commands) section for more options.
113
115
114
116
## Use containers for manual testing
115
117
@@ -122,6 +124,7 @@ Notes:
122
124
* Moodle is configured to listen on `http://localhost:8000/`.
123
125
* Mailhog is listening on `http://localhost:8000/_/mail` to view emails which Moodle has sent out.
124
126
* The admin `username` you need to use for logging in is `admin` by default. You can customize it by passing `--adminuser='myusername'`
127
+
* Check the [Custom commands](#custom-commands) section for more options.
125
128
126
129
## Use containers for running behat tests for the Moodle App
127
130
@@ -158,6 +161,9 @@ Started at 13-07-2020, 18:34
158
161
3m3.17s (55.02Mb)
159
162
```
160
163
164
+
Notes:
165
+
* Check the [Custom commands](#custom-commands) section for more options.
166
+
161
167
If you are going with the second option, this *can* be used for local development of the Moodle App, given that the `moodleapp` container serves the app on the local 8100 port. However, this is intended to run Behat tests that require interacting with a local Moodle environment. Normal development should be easier calling `npm start` in the host system.
162
168
163
169
By all means, if you don't want to have npm installed locally you can go full Docker executing the following commands before starting the containers:
This script was created to easily run any command inside any container. First parameter will be the container name and second one will be the command. Example:
As most of the commands using the `moodle-docker-bash` script will be run on the `webserver` container, this is a shortcut of that script that runs the commands only in the `webserver` container. Example:
This script was created to be automatically installed in the webserver container and to easily run any install command. First parameter will be the database to install (moodle, phpunit or behat) and the rest will be all the parameters that want to be used to override the default one. Note that this script needs to be run either withing the container shell or using `moodle-docker-bash`. Examples:
221
+
```bash
222
+
~$ bin/mbash minstall moodle --fullname="Moodle first instance" --adminpass="admin"
You are already using the latest available Composer version 2.1.8 (stable channel).
234
+
Installing dependencies from lock file (including require-dev)
235
+
```
236
+
237
+
### mtest
238
+
This script was created to be automatically installed in the webserver container and to easily run any test command. First parameter will be the tests to be run (phpunit or behat) and the rest will be all the parameters that want to be used to override the default ones. Note that this script needs to be run either withing the container shell or using `moodle-docker-bash`. Examples:
Php: 7.4.23, pgsql: 11.13 (Debian 11.13-1.pgdg90+1), OS: Linux 5.10.47-linuxkit x86_64
243
+
```
244
+
```bash
245
+
~$ bin/mbash mtest behat --tags=@auth_manual
246
+
Running single behat site:
247
+
```
248
+
249
+
### mutil
250
+
This script was created to be automatically installed in the webserver container and to easily access the `util.php` files of phpunit and behat. First parameter will be the test environment (phpunit or behat) and the rest will be all the parameters that want to be used to override the default ones. Note that this script needs to be run either withing the container shell or using `moodle-docker-bash`. Examples:
251
+
```bash
252
+
~$ bin/mbash mutil phpunit --drop
253
+
Purging dataroot:
254
+
Dropping tables:
255
+
```
256
+
```bash
257
+
~$ bin/mbash mutil behat --drop
258
+
Dropping tables:
259
+
```
260
+
261
+
### mfixversion
262
+
After increasing the version number in a branch, going back to the master branch might cause version problems. This script was created to easily solve that issue. Note that this script needs to be run either withing the container shell or using `moodle-docker-bash`. Example:
0 commit comments