forked from phoenix-oss/llama-stack-mirror
Significantly simpler and malleable test setup (#360)
* Significantly simpler and malleable test setup * convert memory tests * refactor fixtures and add support for composable fixtures * Fix memory to use the newer fixture organization * Get agents tests working * Safety tests work * yet another refactor to make this more general now it accepts --inference-model, --safety-model options also * get multiple providers working for meta-reference (for inference + safety) * Add README.md --------- Co-authored-by: Ashwin Bharambe <ashwin@meta.com>
This commit is contained in:
parent
663883cc29
commit
ffedb81c11
25 changed files with 1491 additions and 790 deletions
24
llama_stack/providers/tests/env.py
Normal file
24
llama_stack/providers/tests/env.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
import os
|
||||
|
||||
|
||||
class MissingCredentialError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def get_env_or_fail(key: str) -> str:
|
||||
"""Get environment variable or raise helpful error"""
|
||||
value = os.getenv(key)
|
||||
if not value:
|
||||
raise MissingCredentialError(
|
||||
f"\nMissing {key} in environment. Please set it using one of these methods:"
|
||||
f"\n1. Export in shell: export {key}=your-key"
|
||||
f"\n2. Create .env file in project root with: {key}=your-key"
|
||||
f"\n3. Pass directly to pytest: pytest --env {key}=your-key"
|
||||
)
|
||||
return value
|
Loading…
Add table
Add a link
Reference in a new issue