From 368c9e68fbae3e5843b922986371e6fff0ec465e Mon Sep 17 00:00:00 2001 From: Adam Wilson Date: Mon, 18 Aug 2025 21:10:50 -0600 Subject: [PATCH] fix path --- .../services/logging/test_run_logging_service.py | 3 ++- tests/conftest.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/text_generation/services/logging/test_run_logging_service.py b/src/text_generation/services/logging/test_run_logging_service.py index 790f3ef77..72f2298a9 100644 --- a/src/text_generation/services/logging/test_run_logging_service.py +++ b/src/text_generation/services/logging/test_run_logging_service.py @@ -22,7 +22,8 @@ class TestRunLoggingService(AbstractTestRunLoggingService): ): self._lock = threading.Lock() timestamp = calendar.timegm(time.gmtime()) - self.log_file_path = str(f"./tests/logs/test_{test_id}/{str(model_id.value).replace("/", "_")}/{start}_{end}/test_{str(test_id).lower()}_logs_{timestamp}.json").lower() + base_path = os.environ.get('TEST_RUNS', '.') + self.log_file_path = os.path.join(base_path, str(f"test_{test_id}/{str(model_id.value).replace("/", "_")}/{start}_{end}/test_{str(test_id).lower()}_logs_{timestamp}.json").lower()) self._ensure_log_file_exists() def _ensure_log_file_exists(self): diff --git a/tests/conftest.py b/tests/conftest.py index bf41f4553..7ecc78fd8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -75,6 +75,7 @@ def setup_test_environment(): os.environ["LOG_LEVEL"] = "DEBUG" os.environ["PROMPT_TEMPLATES_DIR"] = "./infrastructure/prompt_templates" os.environ["INJECTION_DATA_DIR"] = "./tests/security/tests/results/01_garak_no_guidelines" + os.environ["TEST_RUNS"] = "./tests/logs" os.environ["MODEL_BASE_DIR"] = "./infrastructure/foundation_model" os.environ["MODEL_CPU_DIR"] = "cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4" os.environ["MODEL_DATA_FILENAME"] = "phi3-mini-4k-instruct-cpu-int4-rtn-block-32-acc-level-4.onnx.data"