add pytest option to generate a functional report for distribution (#833)

# What does this PR do?

add pytest option (`--report`) to support generating a functional report
for llama stack distribution

## Test Plan
```
export LLAMA_STACK_CONFIG=./llama_stack/templates/fireworks/run.yaml
/opt/miniconda3/envs/stack/bin/pytest -s -v tests/client-sdk/  --report
```

See a report file was generated under
`./llama_stack/templates/fireworks/report.md`


## Sources

Please link relevant resources if necessary.


## Before submitting

- [ ] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [ ] Ran pre-commit to handle lint / formatting issues.
- [ ] Read the [contributor
guideline](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md),
      Pull Request section?
- [ ] Updated relevant documentation.
- [ ] Wrote necessary unit or integration tests.
This commit is contained in:
Sixian Yi 2025-01-21 21:18:23 -08:00 committed by GitHub
parent e41873f268
commit edf56884a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 324 additions and 6 deletions

View file

@ -80,7 +80,7 @@ class TestClientTool(ClientTool):
@pytest.fixture(scope="session")
def model_id(llama_stack_client):
def text_model_id(llama_stack_client):
available_models = [
model.identifier
for model in llama_stack_client.models.list()
@ -92,14 +92,14 @@ def model_id(llama_stack_client):
@pytest.fixture(scope="session")
def agent_config(llama_stack_client, model_id):
def agent_config(llama_stack_client, text_model_id):
available_shields = [
shield.identifier for shield in llama_stack_client.shields.list()
]
available_shields = available_shields[:1]
print(f"Using shield: {available_shields}")
agent_config = AgentConfig(
model=model_id,
model=text_model_id,
instructions="You are a helpful assistant",
sampling_params={
"strategy": {