Omit ui from coverage tests

This commit is contained in:
ChristianZaccaria 2025-07-09 16:43:31 +01:00
parent 901cfcd647
commit 83f3a48539
4 changed files with 6 additions and 28 deletions

View file

@ -6,6 +6,7 @@ omit =
.venv/*
*/llama_stack/cli/scripts/*
*/llama_stack/ui/*
*/llama_stack/distribution/ui/*
*/llama_stack/strong_typing/*
*/llama_stack/env.py
*/__init__.py

View file

@ -16,11 +16,8 @@ on:
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- "3.12"
env:
PYTHON_VERSION: "3.12"
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@ -30,11 +27,11 @@ jobs:
- name: Run unit tests
run: |
PYTHON_VERSION=${{ matrix.python }} ./scripts/unit-tests.sh
PYTHON_VERSION=${{ env.PYTHON_VERSION }} ./scripts/unit-tests.sh
- name: Coverage Badge
uses: tj-actions/coverage-badge-py@1788babcb24544eb5bbb6e0d374df5d1e54e670f # v2.0.4
- name: Verify Changed files
uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20.0.4
id: verify-changed-files

View file

@ -48,16 +48,3 @@ jobs:
pytest-report-${{ matrix.python }}.xml
htmlcov-${{ matrix.python }}/
retention-days: 7
- name: Check coverage
run: |
coverage=$(uv run --python ${{ matrix.python }} --group unit coverage report -m | tail -1 | tail -c 4 | head -c 2)
echo "Total coverage: ${coverage}%"
# Check if coverage is below the threshold
if (( ${coverage} < 40 )); then
echo "Coverage failed at ${coverage}%, expected at least 40%"
exit 1
else
echo "Coverage check passed with ${coverage}%"
fi

View file

@ -19,16 +19,9 @@ Unit tests verify individual components and functions in isolation. They are fas
#### Using the Unit Test Script (Recommended)
The easiest way to run unit tests is using the provided script:
The easiest way to run unit tests is by using the provided script:
```bash
# Activate virtual environment
uv venv .venv --python 3.12
source .venv/bin/activate
# Install dependencies
uv pip install -r requirements.txt
# Run all unit tests and generate coverage report
PYTHON_VERSION=3.12 ./scripts/unit-tests.sh
```