From 51f94df2e788978adc5559576b202c2ea89be72c Mon Sep 17 00:00:00 2001 From: Eric Huang Date: Fri, 1 Aug 2025 12:07:47 -0700 Subject: [PATCH] chore(testing): make LLAMA_STACK_TEST_RECORDING_DIR optional # What does this PR do? ## Test Plan --- llama_stack/testing/inference_recorder.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/llama_stack/testing/inference_recorder.py b/llama_stack/testing/inference_recorder.py index abfefa0ce..ec77986cd 100644 --- a/llama_stack/testing/inference_recorder.py +++ b/llama_stack/testing/inference_recorder.py @@ -79,9 +79,11 @@ def setup_inference_recording(): if mode == InferenceMode.LIVE: return None - if "LLAMA_STACK_TEST_RECORDING_DIR" not in os.environ: - raise ValueError("LLAMA_STACK_TEST_RECORDING_DIR must be set for recording or replaying") - storage_dir = os.environ["LLAMA_STACK_TEST_RECORDING_DIR"] + if "LLAMA_STACK_TEST_RECORDING_DIR" in os.environ: + storage_dir = os.environ["LLAMA_STACK_TEST_RECORDING_DIR"] + else: + logger.warning("LLAMA_STACK_TEST_RECORDING_DIR not set, using default directory: tests/integration/recordings") + storage_dir = "tests/integration/recordings" return inference_recording(mode=mode, storage_dir=storage_dir)