Skip to content

Commit b9a1119

Browse files
committed
test: install DuckDB spatial extension in TestSpatial fixture
The ggsql crate only issues LOAD spatial (never INSTALL), which fails on machines without the extension binary cached under ~/.duckdb/extensions. CI runners start clean, so all TestSpatial tests failed on Linux/macOS and the download attempt hung the Windows test step indefinitely. Also add a 10-minute timeout to the test step to bound future hangs.
1 parent cb0aeef commit b9a1119

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎.github/workflows/python.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ jobs:
7676
7777
- name: Run tests
7878
shell: bash
79+
# Bound the step: a hung extension download once stalled Windows jobs
80+
# indefinitely (tests themselves finish in seconds).
81+
timeout-minutes: 10
7982
run: pytest tests/ -v
8083

8184
# The abi3 wheel is identical across Python legs; keep just one for

‎tests/test_ggsql.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,19 @@ def test_render_multi_layer(self):
220220
class TestSpatial:
221221
"""Tests for spatial (map) layers via the VegaLiteWriter."""
222222

223+
@pytest.fixture(scope="class", autouse=True)
224+
def install_spatial_extension(self):
225+
"""Install DuckDB's spatial extension (the ggsql crate only LOADs it).
226+
227+
The binary is cached per DuckDB version/platform under
228+
~/.duckdb/extensions, so this downloads at most once per machine.
229+
"""
230+
reader = ggsql.DuckDBReader("duckdb://memory")
231+
try:
232+
reader.execute_sql("INSTALL spatial")
233+
except Exception as e:
234+
pytest.skip(f"DuckDB spatial extension unavailable (offline?): {e}")
235+
223236
def test_render_spatial_builtin_world(self):
224237
reader = ggsql.DuckDBReader("duckdb://memory")
225238
spec = reader.execute("VISUALISE FROM ggsql:world DRAW spatial")

0 commit comments

Comments
 (0)