Skip to content

Commit 612a0a9

Browse files
authored
doc: add instructions on how to run the xarray backend tests locally (#1272)
1 parent 121d6ec commit 612a0a9

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

docs/docs/contributing.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ Create / activate a virtual environment:
4545
uv sync
4646
```
4747

48-
4948
Install `maturin`:
5049

5150
=== "Venv"
@@ -85,8 +84,6 @@ Install `maturin`:
8584
maturin develop --uv --extras=test,benchmark
8685
```
8786

88-
89-
9087
#### Testing
9188

9289
The full Python test suite depends on S3 and Azure compatible object stores.
@@ -99,6 +96,34 @@ They can be run from the root of the repo with `docker compose up` (`ctrl-c` the
9996
uv run pytest
10097
```
10198

99+
#### Running Xarray Backend Tests
100+
101+
Icechunk includes integration tests that verify compatibility with Xarray's zarr backend API. These tests require the Xarray repository to be cloned locally.
102+
103+
Set the environment variables (adjust `XARRAY_DIR` to point to your local Xarray clone):
104+
105+
```bash
106+
export ICECHUNK_XARRAY_BACKENDS_TESTS=1
107+
export XARRAY_DIR=~/Documents/dev/xarray # or your xarray location
108+
```
109+
110+
Run the Xarray backend tests:
111+
112+
```bash
113+
python -m pytest -xvs tests/run_xarray_backends_tests.py \
114+
-c $XARRAY_DIR/pyproject.toml \
115+
-W ignore \
116+
--override-ini="addopts="
117+
```
118+
119+
To run a specific Xarray test you have first specify a class defined in `@icechunk-python/tests/run_xarray_backends_tests.py` and then specify an xarray test. For example:
120+
121+
```bash
122+
python -m pytest -xvs tests/run_xarray_backends_tests.py::TestIcechunkStoreFilesystem::test_pickle \
123+
-c $XARRAY_DIR/pyproject.toml \
124+
-W ignore \
125+
--override-ini="addopts="
126+
```
102127

103128
### Rust Development Workflow
104129

@@ -111,6 +136,7 @@ cargo install just
111136
```
112137

113138
Or using other package managers:
139+
114140
- **macOS**: `brew install just`
115141
- **Ubuntu**: `snap install --edge --classic just`
116142

@@ -183,6 +209,7 @@ pre-commit install
183209
```
184210

185211
The pre-commit configuration automatically runs:
212+
186213
- **Every commit**: Fast Python and Rust checks (~2 seconds total)
187214
- **Before push**: Medium Rust checks (compilation + dependencies)
188215
- **Manual**: Full CI-level checks when needed

0 commit comments

Comments
 (0)