Skip to content

Commit ba00dfe

Browse files
committed
fix(tests): include shared dependencies in the unit test environment
Install the shared test dependency group alongside unit-only extras so the supported unit test command can collect provider and library client tests in a clean environment. Update the unit dependency list and test docs to match the validated workflow. Signed-off-by: Sumanth Kamenani <skamenan@redhat.com>
1 parent 8ede748 commit ba00dfe

4 files changed

Lines changed: 26 additions & 9 deletions

File tree

pyproject.toml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,14 @@ type_checking = [
115115
"ollama",
116116
"llama-stack-client==0.4.6",
117117
]
118-
# These are the dependencies required for running unit tests.
118+
# These are additional dependencies required for running unit tests beyond the
119+
# shared `test` dependency group.
119120
unit = [
120121
"anthropic",
121122
"databricks-sdk",
122123
"sqlite-vec",
123124
"ollama",
125+
"llama-stack-client==0.4.6",
124126
"aiosqlite",
125127
"aiohttp",
126128
"psycopg2-binary>=2.9.0",
@@ -129,17 +131,21 @@ unit = [
129131
"chardet",
130132
"sqlalchemy",
131133
"sqlalchemy[asyncio]>=2.0.41",
134+
"torch>=2.6.0",
135+
"torchvision>=0.21.0",
136+
"fairscale",
132137
"blobfile",
133138
"faiss-cpu",
134139
"litellm",
135140
"together",
136141
"coverage",
137142
"moto[s3]>=5.1.10",
138143
]
139-
# These are the core dependencies required for running integration tests. They are shared across all
140-
# providers. If a provider requires additional dependencies, please add them to your environment
141-
# separately. If you are using "uv" to execute your tests, you can use the "--group" flag to specify extra
142-
# dependencies.
144+
# These are the core dependencies shared across test environments. Integration
145+
# tests use this group directly, and the unit test wrapper installs it alongside
146+
# the `unit` group. If a provider requires additional dependencies, please add
147+
# them to your environment separately. If you are using "uv" to execute your
148+
# tests, you can use the "--group" flag to specify extra dependencies.
143149
test = [
144150
"aiosqlite",
145151
"aiohttp",

scripts/unit-tests.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ if [ $FOUND_PYTHON -ne 0 ]; then
2525
uv python install "$PYTHON_VERSION"
2626
fi
2727

28-
# Run unit tests with coverage
29-
uv run --python "$PYTHON_VERSION" --with-editable . --group unit \
28+
# Run unit tests with coverage. The shared `test` group provides core provider
29+
# dependencies, and `unit` layers on unit-only extras.
30+
uv run --python "$PYTHON_VERSION" --with-editable . --group test --group unit \
3031
coverage run --source=src/llama_stack -m pytest -s -v tests/unit/ "$@"

tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This gives you:
2626

2727
You can run the unit tests with:
2828
```bash
29-
uv run --group unit pytest -sv tests/unit/
29+
uv run --group test --group unit pytest -sv tests/unit/
3030
```
3131

3232
For running integration tests, you must provide a few things:

uv.lock

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)