|
1 | 1 | # Moodle Web Installation Testing
|
2 | 2 |
|
3 |
| -This project is a testing suite for the Moodle web installation process. It uses PHP, Composer, and JavaScript to perform the tests. |
| 3 | +This repository contains the testing suite for the Moodle web installation process. |
4 | 4 |
|
5 |
| -## Getting Started |
6 |
| - |
7 |
| -These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. |
8 |
| - |
9 |
| -### Prerequisites |
10 |
| - |
11 |
| -- PHP |
12 |
| -- Composer |
13 |
| -- JavaScript |
14 |
| - |
15 |
| -### Installing |
16 |
| - |
17 |
| -Clone the repository: |
| 5 | +## Pre-requisites |
| 6 | +- A web server with PHP and a database server installed, as if you were going to install Moodle manually. |
| 7 | +- Composer installed. |
| 8 | +- The Moodle codebase, you can clone the code from the Moodle repository. |
18 | 9 |
|
| 10 | +## Getting Started |
19 | 11 | ```bash
|
| 12 | +# Get Moodle code, you could select another version branch (skip this if you already got the code) |
| 13 | +git clone -b main git://git.moodle.org/moodle.git moodle |
| 14 | + |
| 15 | +# Clone the web install repository. |
20 | 16 | git clone [email protected]:lameze/moodle-webinstall.git
|
| 17 | +cd moodle-webinstall |
| 18 | + |
| 19 | +# Install the dependencies. |
| 20 | +composer install |
| 21 | + |
| 22 | +# URL to the moodle site to be installed. |
| 23 | +export MOODLE_SITE_URL="http://localhost/moodle" |
| 24 | + |
| 25 | +# Database connection details, ensure the database is created before running the tests. |
| 26 | +export DB_TYPE=pgsql |
| 27 | +export DB_HOST=localhost |
| 28 | +export DB_NAME=moodle |
| 29 | +export DB_USER=postgres |
| 30 | +export DB_PASS=moodle |
| 31 | + |
| 32 | +# Ensure the site to be installed has write permissions so moodle can write the config.php file. |
| 33 | +sudo chown -R www-data:www-data /path/to/moodle |
| 34 | + |
| 35 | +# Run the tests |
| 36 | +/vendor/bin/behat |
| 37 | +``` |
| 38 | +The test execution usually takes around 54 seconds to complete, the common issues that might prevent the tests from passing are: |
| 39 | +- The database connection details are incorrect. |
| 40 | +- The moodle site URL is incorrect. |
| 41 | +- The moodle site directory does not have write permissions and Moodle is unable to write the config.php file. |
0 commit comments