From f4cecaade94456135f33057ec678542593a839bf Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Mon, 18 Aug 2025 10:11:55 -0700 Subject: [PATCH] chore(ci): dont run llama stack server always (#3188) Sometimes the server has already been started (e.g., via docker). Just a convenience here so we can reuse this script more. --- scripts/integration-tests.sh | 43 ++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/scripts/integration-tests.sh b/scripts/integration-tests.sh index bf7671348..e9a5283e1 100755 --- a/scripts/integration-tests.sh +++ b/scripts/integration-tests.sh @@ -133,6 +133,10 @@ else EXTRA_PARAMS="" fi +THIS_DIR=$(dirname "$0") +ROOT_DIR="$THIS_DIR/.." +cd $ROOT_DIR + # Set recording directory if [[ "$RUN_VISION_TESTS" == "true" ]]; then export LLAMA_STACK_TEST_RECORDING_DIR="tests/integration/recordings/vision" @@ -142,24 +146,29 @@ fi # Start Llama Stack Server if needed if [[ "$STACK_CONFIG" == *"server:"* ]]; then - echo "=== Starting Llama Stack Server ===" - nohup uv run llama stack run ci-tests --image-type venv > server.log 2>&1 & + # check if server is already running + if curl -s http://localhost:8321/v1/health 2>/dev/null | grep -q "OK"; then + echo "Llama Stack Server is already running, skipping start" + else + echo "=== Starting Llama Stack Server ===" + nohup uv run llama stack run ci-tests --image-type venv > server.log 2>&1 & - echo "Waiting for Llama Stack Server to start..." - for i in {1..30}; do - if curl -s http://localhost:8321/v1/health 2>/dev/null | grep -q "OK"; then - echo "✅ Llama Stack Server started successfully" - break - fi - if [[ $i -eq 30 ]]; then - echo "❌ Llama Stack Server failed to start" - echo "Server logs:" - cat server.log - exit 1 - fi - sleep 1 - done - echo "" + echo "Waiting for Llama Stack Server to start..." + for i in {1..30}; do + if curl -s http://localhost:8321/v1/health 2>/dev/null | grep -q "OK"; then + echo "✅ Llama Stack Server started successfully" + break + fi + if [[ $i -eq 30 ]]; then + echo "❌ Llama Stack Server failed to start" + echo "Server logs:" + cat server.log + exit 1 + fi + sleep 1 + done + echo "" + fi fi # Run tests