mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-23 00:32:26 +00:00
Temporary Commit at 1/6/2025, 8:13:09 PM
Summary: ### THIS DIFF ### PLAN ### CONTEXT ### DESIGN Test Plan: # Test Setup **Type checker and check that the build compiles** **Unit Tests** **E2E Tests** // Screenshots and videos | Before | After | |--| | … | … | # Monitoring Plan.
This commit is contained in:
parent
b719743be9
commit
bf610adf9b
25 changed files with 305 additions and 3 deletions
36
llama_stack/providers/tests/test.py
Normal file
36
llama_stack/providers/tests/test.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import os
|
||||
import subprocess
|
||||
|
||||
import yaml
|
||||
|
||||
TEST_CONFIG_YAML = "test-config.yaml"
|
||||
OUTPUT_FILE = "run_tests.sh"
|
||||
|
||||
|
||||
def get_data(yaml_file_name):
|
||||
with open(yaml_file_name, "r") as f:
|
||||
data = yaml.safe_load(f)
|
||||
return data
|
||||
|
||||
|
||||
def main():
|
||||
test_config_yaml_path = os.path.join(os.path.dirname(__file__), TEST_CONFIG_YAML)
|
||||
data = get_data(test_config_yaml_path)
|
||||
output_file_path = os.path.join(os.path.dirname(__file__), OUTPUT_FILE)
|
||||
with open(output_file_path, "w") as f:
|
||||
print("Started writing to {}".format(OUTPUT_FILE))
|
||||
for provider in data["providers"].split(" "):
|
||||
for model in data["inference_models"]:
|
||||
inference_model, test_file = data["inference_models"][model].split(",")
|
||||
f.write(
|
||||
'pytest -v -s -k "{}" --inference-model="{}" ./llama_stack/providers/tests/inference/{}\n'.format(
|
||||
provider, inference_model, test_file[1:]
|
||||
)
|
||||
)
|
||||
print("Finished writing to {}".format(OUTPUT_FILE))
|
||||
subprocess.run(["chmod", "+x", output_file_path])
|
||||
subprocess.run(["bash", output_file_path])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue