From acf7c240d8e29835aa944b6c735d375e04e39033 Mon Sep 17 00:00:00 2001 From: ochafik Date: Sat, 18 Jan 2025 02:39:37 +0000 Subject: [PATCH] tools: run tool call slow tests when SLOW_TESTS=1 (+ prefetch models) --- examples/server/tests/tests.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/server/tests/tests.sh b/examples/server/tests/tests.sh index 87526c3b4..e61d01b16 100755 --- a/examples/server/tests/tests.sh +++ b/examples/server/tests/tests.sh @@ -1,14 +1,23 @@ #!/bin/bash # make sure we are in the right directory -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -cd $SCRIPT_DIR +TESTS_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +cd $TESTS_DIR set -eu +if [[ "${SLOW_TESTS:-0}" == 1 ]]; then + # Slow tests for tool calls need quite a few models ahead of time to avoid timing out. + python $TESTS_DIR/../../../scripts/fetch_server_test_models.py +fi + if [ $# -lt 1 ] then - pytest -v -x -m "not slow" + if [[ "${SLOW_TESTS:-0}" == 1 ]]; then + pytest -v -x + else + pytest -v -x -m "not slow" + fi else pytest "$@" fi