From 4724c144a8d1a022867390c583a2e87affa12d8c Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Mon, 1 Apr 2024 20:43:22 -0400 Subject: [PATCH] pytest: don't delete logs on-device (#32080) fix log deletion old-commit-hash: c09cf4983bd5e4b83ce58ac033661e6e79a88770 --- common/prefix.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/prefix.py b/common/prefix.py index 4059ac09e2..3292acae86 100644 --- a/common/prefix.py +++ b/common/prefix.py @@ -4,6 +4,7 @@ import uuid from openpilot.common.params import Params +from openpilot.system.hardware import PC from openpilot.system.hardware.hw import Paths from openpilot.system.hardware.hw import DEFAULT_DOWNLOAD_CACHE_ROOT @@ -45,7 +46,8 @@ class OpenpilotPrefix: shutil.rmtree(os.path.realpath(symlink_path), ignore_errors=True) os.remove(symlink_path) shutil.rmtree(self.msgq_path, ignore_errors=True) - shutil.rmtree(Paths.log_root(), ignore_errors=True) + if PC: + shutil.rmtree(Paths.log_root(), ignore_errors=True) if not os.environ.get("COMMA_CACHE", False): shutil.rmtree(Paths.download_cache_root(), ignore_errors=True) shutil.rmtree(Paths.comma_home(), ignore_errors=True)