Skip to content

Commit 779cc5c

Browse files
committed
fix(test): set ETL_DATA_ROOT to tmp_path in integration tests
save_metadata calls ensure_dataset_dirs which creates dirs under ETL_DATA_ROOT (/app/data by default). In CI this path doesn't exist and is not writable. Use monkeypatch to redirect to tmp_path.
1 parent 65b6b89 commit 779cc5c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/integration/test_service_endpoints.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import json
77
import os
88
import sys
9+
import tempfile
910

1011
import pytest
1112
from prometheus_client import REGISTRY
@@ -39,7 +40,11 @@ def _clear_app_modules():
3940
# ── Fixtures: Flask test clients ──
4041

4142
@pytest.fixture
42-
def clean_nan_client():
43+
def clean_nan_client(tmp_path, monkeypatch):
44+
monkeypatch.setenv("ETL_DATA_ROOT", str(tmp_path))
45+
# Reload path_utils so it picks up the new ETL_DATA_ROOT
46+
import common.path_utils as _pu
47+
monkeypatch.setattr(_pu, "DATA_ROOT", str(tmp_path))
4348
_clear_app_modules()
4449
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "services", "clean-nan-service"))
4550
from app import create_app

0 commit comments

Comments
 (0)