From ffe3784bbfa33cbe8d697748c5d9ea0bb4f7b0d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Monlla=C3=B3?= <davidm@moodle.com>
Date: Thu, 5 Dec 2019 19:08:38 +0800
Subject: [PATCH] mlbackend_python: Add tests

---
 README.md                     | 2 +-
 config.docker-template.php    | 5 +++++
 phpunit-external-services.yml | 2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 80ecff4986c..462f3769eec 100755
--- a/README.md
+++ b/README.md
@@ -127,7 +127,7 @@ You can change the configuration of the docker images by setting various environ
 | `MOODLE_DOCKER_WWWROOT`                   | yes       | path on your file system              | none          | The path to the Moodle codebase you intend to test                           |
 | `MOODLE_DOCKER_PHP_VERSION`               | no        | 7.4, 7.3, 7.2, 7.1, 7.0, 5.6          | 7.2           | The php version to use                                                       |
 | `MOODLE_DOCKER_BROWSER`                   | no        | firefox, chrome                       | firefox       | The browser to run Behat against                                             |
-| `MOODLE_DOCKER_PHPUNIT_EXTERNAL_SERVICES` | no        | any value                             | not set       | If set, dependencies for memcached, redis, solr, and openldap are added      |
+| `MOODLE_DOCKER_PHPUNIT_EXTERNAL_SERVICES` | no        | any value                             | not set       | If set, dependencies for memcached, redis, solr, and others are added        |
 | `MOODLE_DOCKER_WEB_HOST`                  | no        | any valid hostname                    | localhost     | The hostname for web                                |
 | `MOODLE_DOCKER_WEB_PORT`                  | no        | any integer value                     | 8000          | The port number for web. If set to 0, no port is used                        |
 | `MOODLE_DOCKER_SELENIUM_VNC_PORT`         | no        | any integer value                     | not set       | If set, the selenium node will expose a vnc session on the port specified    |
diff --git a/config.docker-template.php b/config.docker-template.php
index 4d54a487252..20f4732fcb9 100755
--- a/config.docker-template.php
+++ b/config.docker-template.php
@@ -80,6 +80,11 @@
     define('TEST_ENROL_LDAP_BIND_DN', 'cn=admin,dc=openstack,dc=org');
     define('TEST_ENROL_LDAP_BIND_PW', 'password');
     define('TEST_ENROL_LDAP_DOMAIN', 'ou=Users,dc=openstack,dc=org');
+
+    define('TEST_MLBACKEND_PYTHON_HOST', 'mlbackendpython');
+    define('TEST_MLBACKEND_PYTHON_PORT', 5000);
+    define('TEST_MLBACKEND_PYTHON_USERNAME', 'default');
+    define('TEST_MLBACKEND_PYTHON_PASSWORD', 'sshhhh');
 }
 
 require_once(__DIR__ . '/lib/setup.php');
diff --git a/phpunit-external-services.yml b/phpunit-external-services.yml
index 1ca2f264c51..f640c50166e 100644
--- a/phpunit-external-services.yml
+++ b/phpunit-external-services.yml
@@ -19,3 +19,5 @@ services:
       - test
   ldap:
     image: larrycai/openldap
+  mlbackendpython:
+    image: "moodlehq/moodle-mlbackend-python:2.3.0-python3.7.5"