Skip to content

Commit 4cd99f6

Browse files
fix: create storage directories in test fixtures for StorageBackend validation
All 24 object storage test failures were due to test fixtures not creating the directories they configured. StorageBackend validates that file protocol locations exist, so fixtures must create them. - conftest.py: Create test_project subdirectory in object_storage_config - test_update1.py: Create djtest subdirectories in mock_stores_update Test results: 520 passed, 7 skipped, 0 failures ✓
1 parent 5ccf3aa commit 4cd99f6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tests/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,9 @@ def object_storage_config(tmpdir_factory):
827827
base_location = str(tmpdir_factory.mktemp("object_storage"))
828828
# Location now includes project context
829829
location = f"{base_location}/test_project"
830+
# Create the directory (StorageBackend validates it exists)
831+
from pathlib import Path
832+
Path(location).mkdir(parents=True, exist_ok=True)
830833
return {
831834
"protocol": "file",
832835
"location": location,

tests/integration/test_update1.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,19 @@ class Thing(dj.Manual):
2424
@pytest.fixture(scope="module")
2525
def mock_stores_update(tmpdir_factory):
2626
"""Configure stores for update tests using unified stores system."""
27+
from pathlib import Path
28+
2729
og_stores = dict(dj.config.stores)
2830

2931
# Configure stores (location includes project context)
3032
store_location = str(tmpdir_factory.mktemp("store")) + "/djtest"
3133
repo_stage = str(tmpdir_factory.mktemp("repo_stage"))
3234
repo_location = str(tmpdir_factory.mktemp("repo_loc")) + "/djtest"
3335

36+
# Create the directories (StorageBackend validates they exist)
37+
Path(store_location).mkdir(parents=True, exist_ok=True)
38+
Path(repo_location).mkdir(parents=True, exist_ok=True)
39+
3440
dj.config.stores["update_store"] = dict(
3541
protocol="file",
3642
location=store_location,

0 commit comments

Comments
 (0)