fix: make AssetManager registry path relative to storage_path by default
Some checks failed
Test Suite / unit-tests (3.11) (push) Has been cancelled
Test Suite / unit-tests (3.12) (push) Has been cancelled
Test Suite / integration-tests (push) Has been cancelled
Test Suite / e2e-tests (push) Has been cancelled
Test Suite / performance-tests (push) Has been cancelled
Test Suite / code-quality (push) Has been cancelled
Test Suite / security-scan (push) Has been cancelled
Test Suite / test-summary (push) Has been cancelled
Some checks failed
Test Suite / unit-tests (3.11) (push) Has been cancelled
Test Suite / unit-tests (3.12) (push) Has been cancelled
Test Suite / integration-tests (push) Has been cancelled
Test Suite / e2e-tests (push) Has been cancelled
Test Suite / performance-tests (push) Has been cancelled
Test Suite / code-quality (push) Has been cancelled
Test Suite / security-scan (push) Has been cancelled
Test Suite / test-summary (push) Has been cancelled
This is a robust fix for test registry isolation that addresses the root cause: when AssetManager is created with only storage_path, the registry now defaults to storage_path.parent/asset_registry.json instead of cwd/asset_registry.json. Benefits: - Tests using temp directories automatically get isolated registries - No need to manually fix every test file - Consistent behavior: registry stays with the asset storage - Explicit registry_path still works for custom configurations This makes the AssetManager behavior more intuitive and prevents test artifacts from contaminating the production asset registry. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -64,8 +64,10 @@ class AssetManager:
|
||||
assets_config.get('storage_path', DEFAULT_ASSETS_DIR)
|
||||
).resolve()
|
||||
|
||||
# Default registry path should be relative to storage_path, not cwd
|
||||
default_registry_path = self.storage_path.parent / DEFAULT_REGISTRY_FILENAME
|
||||
self.registry_path = Path(
|
||||
assets_config.get('registry_path', DEFAULT_REGISTRY_FILENAME)
|
||||
assets_config.get('registry_path', default_registry_path)
|
||||
).resolve()
|
||||
|
||||
self.database_path = Path(
|
||||
|
||||
Reference in New Issue
Block a user