Skip to content

Commit 91bb257

Browse files
DOC: Update CONTRIBUTING.md with local services setup and test instructions
Closes #1708 - Add 'Starting Local Services' section with required permission step (chown/chmod data/php) before running docker compose, as implemented in #1697 - Extend testing guide with OPENML_USE_LOCAL_SERVICES env var instructions for running pytest against local services (Linux/macOS and Windows)
1 parent 8cc6429 commit 91bb257

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,43 @@ However, it is also possible to use the [openml-python docker image](https://git
7676
pre-commit install
7777
```
7878

79+
### Starting Local Services
80+
81+
The test suite runs against local services via Docker. Before starting the services for the first time, set the required file permissions:
82+
83+
```bash
84+
chown -R www-data:www-data data/php
85+
# Or, if the above fails (e.g. because `www-data` does not exist on your system):
86+
chmod -R 777 data/php
87+
```
88+
89+
Then clone the [openml/services](https://github.com/openml/services) repository and start the services:
90+
91+
```bash
92+
git clone https://github.com/openml/services.git
93+
cd services
94+
docker compose --profile rest-api --profile minio up -d
95+
```
96+
7997
### Testing (Your Installation)
8098
To test your installation and run the tests for the first time, run the following from the repository folder:
8199
```bash
82100
pytest tests
83101
```
84102
For Windows systems, you may need to add `pytest` to PATH before executing the command.
85103

104+
To run tests against the local services (started with `docker compose` above), set the `OPENML_USE_LOCAL_SERVICES` environment variable before running `pytest`:
105+
106+
```bash
107+
# Linux/macOS
108+
export OPENML_USE_LOCAL_SERVICES="true"
109+
pytest tests
110+
111+
# Windows
112+
$env:OPENML_USE_LOCAL_SERVICES = "true"
113+
pytest tests
114+
```
115+
86116
Executing a specific unit test can be done by specifying the module, test case, and test.
87117
You may then run a specific module, test case, or unit test respectively:
88118
```bash
@@ -214,4 +244,4 @@ When dependencies are installed, run
214244
```bash
215245
mkdocs serve
216246
```
217-
This will open a preview of the website.
247+
This will open a preview of the website.

0 commit comments

Comments
 (0)