mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-13 00:26:10 +00:00
build: add missing dev dependencies for unit tests (#1004)
# What does this PR do? Added necessary dependencies to ensure successful execution of unit tests. Without these, the following command would fail due to missing imports: ``` uv run pytest -v -k "ollama" \ --inference-model=llama3.2:3b-instruct-fp16 llama_stack/providers/tests/inference/test_model_registration.py ``` Signed-off-by: Sébastien Han <seb@redhat.com> [//]: # (If resolving an issue, uncomment and update the line below) [//]: # (Closes #[issue-number]) ## Test Plan Run: ``` ollama run llama3.2:3b-instruct-fp16 --keepalive 2m & uv run pytest -v -k "ollama" --inference-model=llama3.2:3b-instruct-fp16 llama_stack/providers/tests/inference/test_model_registration.py ``` You can observe that some tests pass while others fail, but the test runs successfully. [//]: # (## Documentation) [//]: # (- [ ] Added a Changelog entry if the change is significant) Signed-off-by: Sébastien Han <seb@redhat.com> Co-authored-by: Ashwin Bharambe <ashwin.bharambe@gmail.com>
This commit is contained in:
parent
61f43b8677
commit
69eebaf5bf
4 changed files with 787 additions and 263 deletions
|
@ -12,6 +12,20 @@ We use `pytest` and all of its dynamism to enable the features needed. Specifica
|
|||
|
||||
- We use `pytest_collection_modifyitems` to filter tests based on the test config (if specified).
|
||||
|
||||
## Pre-requisites
|
||||
|
||||
Your development environment should have been configured as per the instructions in the
|
||||
[CONTRIBUTING.md](../../../CONTRIBUTING.md) file. In particular, make sure to install the test extra
|
||||
dependencies. Below is the full configuration:
|
||||
|
||||
|
||||
```bash
|
||||
$ cd llama-stack
|
||||
$ uv sync --extra dev --extra test
|
||||
$ uv pip install -e .
|
||||
$ source .venv/bin/activate
|
||||
```
|
||||
|
||||
## Common options
|
||||
|
||||
All tests support a `--providers` option which can be a string of the form `api1=provider_fixture1,api2=provider_fixture2`. So, when testing safety (which need inference and safety APIs) you can use `--providers inference=together,safety=meta_reference` to use these fixtures in concert.
|
||||
|
@ -50,6 +64,9 @@ pytest -s -v llama_stack/providers/tests/inference/test_text_inference.py \
|
|||
--env FIREWORKS_API_KEY=<...>
|
||||
```
|
||||
|
||||
> [!TIP]
|
||||
> If you’re using `uv`, you can isolate test executions by prefixing all commands with `uv run pytest...`.
|
||||
|
||||
## Agents
|
||||
|
||||
The Agents API composes three other APIs underneath:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue