pytest: add marker for sharing the download cache (#31082)

* fix cache

* with a marker
This commit is contained in:
Justin Newberry
2024-01-22 16:30:59 -08:00
committed by GitHub
parent 7c9530f743
commit 3846130d8e
5 changed files with 22 additions and 6 deletions
+4 -2
View File
@@ -3,6 +3,8 @@ from pathlib import Path
from openpilot.system.hardware import PC
DEFAULT_DOWNLOAD_CACHE_ROOT = "/tmp/comma_download_cache"
class Paths:
@staticmethod
def comma_home() -> str:
@@ -31,8 +33,8 @@ class Paths:
@staticmethod
def download_cache_root() -> str:
if os.environ.get('COMMA_CACHE', False):
return os.environ['COMMA_CACHE']
return "/tmp/comma_download_cache" + os.environ.get("OPENPILOT_PREFIX", "") + "/"
return os.environ['COMMA_CACHE'] + "/"
return DEFAULT_DOWNLOAD_CACHE_ROOT + os.environ.get("OPENPILOT_PREFIX", "") + "/"
@staticmethod
def persist_root() -> str: