From 91bb257afee5fd0927e09ca771aa64e51462159d Mon Sep 17 00:00:00 2001 From: nishtha-agarwal-211 Date: Tue, 10 Mar 2026 10:41:54 +0530 Subject: [PATCH] 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) --- CONTRIBUTING.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d194525ef..164a4e573 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,6 +76,24 @@ However, it is also possible to use the [openml-python docker image](https://git pre-commit install ``` +### Starting Local Services + +The test suite runs against local services via Docker. Before starting the services for the first time, set the required file permissions: + +```bash +chown -R www-data:www-data data/php +# Or, if the above fails (e.g. because `www-data` does not exist on your system): +chmod -R 777 data/php +``` + +Then clone the [openml/services](https://github.com/openml/services) repository and start the services: + +```bash +git clone https://github.com/openml/services.git +cd services +docker compose --profile rest-api --profile minio up -d +``` + ### Testing (Your Installation) To test your installation and run the tests for the first time, run the following from the repository folder: ```bash @@ -83,6 +101,18 @@ pytest tests ``` For Windows systems, you may need to add `pytest` to PATH before executing the command. +To run tests against the local services (started with `docker compose` above), set the `OPENML_USE_LOCAL_SERVICES` environment variable before running `pytest`: + +```bash +# Linux/macOS +export OPENML_USE_LOCAL_SERVICES="true" +pytest tests + +# Windows +$env:OPENML_USE_LOCAL_SERVICES = "true" +pytest tests +``` + Executing a specific unit test can be done by specifying the module, test case, and test. You may then run a specific module, test case, or unit test respectively: ```bash @@ -214,4 +244,4 @@ When dependencies are installed, run ```bash mkdocs serve ``` -This will open a preview of the website. \ No newline at end of file +This will open a preview of the website.