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
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)
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+31-1Lines changed: 31 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,13 +76,43 @@ However, it is also possible to use the [openml-python docker image](https://git
76
76
pre-commit install
77
77
```
78
78
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
+
79
97
### Testing (Your Installation)
80
98
To test your installation and run the tests for the first time, run the following from the repository folder:
81
99
```bash
82
100
pytest tests
83
101
```
84
102
For Windows systems, you may need to add `pytest` to PATH before executing the command.
85
103
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
+
86
116
Executing a specific unit test can be done by specifying the module, test case, and test.
87
117
You may then run a specific module, test case, or unit test respectively:
88
118
```bash
@@ -214,4 +244,4 @@ When dependencies are installed, run
0 commit comments