chore: Add ./scripts/unit-tests.sh

Useful for local development. Now you can just trigger the script and
not care about specific arguments to pass to run unit tests.

You can also pass PYTHON_VERSION= through envvar to change the default
python version used (default: 3.10).

Co-authored-by: Nathan Weinberg <31703736+nathan-weinberg@users.noreply.github.com>
Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
This commit is contained in:
Ihar Hrachyshka 2025-03-10 10:34:27 -04:00
parent d072b5fa0c
commit 4c6a339de9
3 changed files with 36 additions and 1 deletions

View file

@ -33,7 +33,7 @@ jobs:
- name: Run unit tests
run: |
uv run --python ${{ matrix.python }} --with-editable . --with-editable ".[dev]" --with-editable ".[unit]" pytest --cov=llama_stack -s -v tests/unit/ --junitxml=pytest-report-${{ matrix.python }}.xml --cov-report=html:htmlcov-${{ matrix.python }}
PYTHON_VERSION=${{ matrix.python }} ./scripts/unit-tests.sh --cov=llama_stack --junitxml=pytest-report-${{ matrix.python }}.xml --cov-report=html:htmlcov-${{ matrix.python }}
- name: Upload test results
if: always()