chore(testing): make LLAMA_STACK_TEST_RECORDING_DIR optional

# What does this PR do?


## Test Plan
This commit is contained in:
Eric Huang 2025-08-01 12:07:47 -07:00
parent 140ee7d337
commit 51f94df2e7

View file

@ -79,9 +79,11 @@ def setup_inference_recording():
if mode == InferenceMode.LIVE: if mode == InferenceMode.LIVE:
return None return None
if "LLAMA_STACK_TEST_RECORDING_DIR" not in os.environ: if "LLAMA_STACK_TEST_RECORDING_DIR" 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"]
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) return inference_recording(mode=mode, storage_dir=storage_dir)