Skip to content

Commit 69fd05b

Browse files
authored
docs: Improve Python testing instructions in contributors-guide.md (#184)
1 parent 7f91135 commit 69fd05b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

docs/contributors-guide.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ native component with:
155155
maturin develop
156156
```
157157
158+
If you don't yet have maturin installed, you can install it using pip
159+
160+
```shell
161+
pip install maturin
162+
```
163+
158164
## Debugging
159165

160166
### Rust
@@ -175,6 +181,40 @@ Rust, C, or C++ code can be debugged using the
175181
[CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)
176182
*Attach to Process...* command from the command palette in VSCode.
177183
184+
## Testing
185+
186+
### Running Rust tests
187+
188+
We use cargo to run the Rust tests.
189+
190+
```shell
191+
cargo test
192+
```
193+
194+
### Running Python tests
195+
196+
A large number of the Python tests rely on a running PostGIS instance. You can spin one up by using the providied PostGIS docker compose file.
197+
198+
```shell
199+
docker compose up -d
200+
```
201+
202+
You can later shut it down with
203+
204+
```shell
205+
docker compose down
206+
```
207+
208+
To run the actual Python tests, you can use pytest.
209+
210+
e.g Run all of the tests
211+
212+
```shell
213+
pytest python/sedonadb/tests
214+
```
215+
216+
Remember that you need to run `maturin develop` to update your python installation after changes in Rust code.
217+
178218
## Low-level benchmarking
179219

180220
Low-level Rust benchmarks use [criterion](https://github.com/bheisler/criterion.rs).

0 commit comments

Comments
 (0)