forked from phoenix-oss/llama-stack-mirror
chore: Add ./scripts/unit-tests.sh (#1515)
# What does this PR do? Useful for local development. Now you can just trigger the script and not care about specific arguments to pass to run unit tests. [//]: # (If resolving an issue, uncomment and update the line below) [//]: # (Closes #[issue-number]) ## Test Plan ``` $ . ./venv/bin/activate $ ./scripts/run_tests.sh $ echo $? 0 ``` [//]: # (## Documentation) Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com> Co-authored-by: Nathan Weinberg <31703736+nathan-weinberg@users.noreply.github.com>
This commit is contained in:
parent
33b096cc21
commit
bfc79217a8
3 changed files with 36 additions and 1 deletions
19
scripts/unit-tests.sh
Executable file
19
scripts/unit-tests.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
PYTHON_VERSION=${PYTHON_VERSION:-3.10}
|
||||
|
||||
command -v uv >/dev/null 2>&1 || { echo >&2 "uv is required but it's not installed. Exiting."; exit 1; }
|
||||
|
||||
uv python find $PYTHON_VERSION
|
||||
FOUND_PYTHON=$?
|
||||
if [ $FOUND_PYTHON -ne 0 ]; then
|
||||
uv python install $PYTHON_VERSION
|
||||
fi
|
||||
|
||||
uv run --python $PYTHON_VERSION --with-editable . --with-editable ".[dev]" --with-editable ".[unit]" pytest -s -v tests/unit/ $@
|
Loading…
Add table
Add a link
Reference in a new issue