mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-23 02:12:26 +00:00
Add coverage dependency to 'unit' group in pyproject.toml file
This commit is contained in:
parent
463de5cce9
commit
24a4a1e167
3 changed files with 3 additions and 5 deletions
4
.github/workflows/unit-tests.yml
vendored
4
.github/workflows/unit-tests.yml
vendored
|
|
@ -51,7 +51,7 @@ jobs:
|
||||||
|
|
||||||
- name: Check coverage
|
- name: Check coverage
|
||||||
run: |
|
run: |
|
||||||
coverage=$(uv run --python $PYTHON_VERSION coverage report -m | tail -1 | tail -c 4 | head -c 2)
|
coverage=$(uv run --python ${{ matrix.python }} --group unit coverage report -m | tail -1 | tail -c 4 | head -c 2)
|
||||||
echo "Total coverage: ${coverage}%"
|
echo "Total coverage: ${coverage}%"
|
||||||
|
|
||||||
# Check if coverage is below the threshold
|
# Check if coverage is below the threshold
|
||||||
|
|
@ -59,5 +59,5 @@ jobs:
|
||||||
echo "Coverage failed at ${coverage}%, expected at least 40%"
|
echo "Coverage failed at ${coverage}%, expected at least 40%"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "Coverage passed, ${coverage}%"
|
echo "Coverage check passed with ${coverage}%"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ unit = [
|
||||||
"pymilvus>=2.5.12",
|
"pymilvus>=2.5.12",
|
||||||
"litellm",
|
"litellm",
|
||||||
"together",
|
"together",
|
||||||
|
"coverage",
|
||||||
]
|
]
|
||||||
# These are the core dependencies required for running integration tests. They are shared across all
|
# These are the core dependencies required for running integration tests. They are shared across all
|
||||||
# providers. If a provider requires additional dependencies, please add them to your environment
|
# providers. If a provider requires additional dependencies, please add them to your environment
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,6 @@ if [ $FOUND_PYTHON -ne 0 ]; then
|
||||||
uv python install "$PYTHON_VERSION"
|
uv python install "$PYTHON_VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install coverage if not installed
|
|
||||||
uv pip install coverage >/dev/null 2>&1
|
|
||||||
|
|
||||||
uv run --python "$PYTHON_VERSION" --with-editable . --group unit \
|
uv run --python "$PYTHON_VERSION" --with-editable . --group unit \
|
||||||
coverage run --source=llama_stack -m pytest -s -v tests/unit/ "$@" && \
|
coverage run --source=llama_stack -m pytest -s -v tests/unit/ "$@" && \
|
||||||
uv run --python "$PYTHON_VERSION" coverage html -d htmlcov-$PYTHON_VERSION
|
uv run --python "$PYTHON_VERSION" coverage html -d htmlcov-$PYTHON_VERSION
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue