fix: stop printing server log, it is confusing
Some checks failed
Pre-commit / pre-commit (push) Failing after 2s
Python Package Build Test / build (3.13) (push) Failing after 1s
Integration Tests (Replay) / Integration Tests (, , , client=, ) (push) Failing after 4s
API Conformance Tests / check-schema-compatibility (push) Successful in 13s
Integration Auth Tests / test-matrix (oauth2_token) (push) Failing after 1s
SqlStore Integration Tests / test-postgres (3.12) (push) Failing after 0s
SqlStore Integration Tests / test-postgres (3.13) (push) Failing after 0s
Vector IO Integration Tests / test-matrix (push) Failing after 6s
Test External Providers Installed via Module / test-external-providers-from-module (venv) (push) Has been skipped
Python Package Build Test / build (3.12) (push) Failing after 1s
Unit Tests / unit-tests (3.12) (push) Failing after 4s
Test External API and Providers / test-external (venv) (push) Failing after 5s
Unit Tests / unit-tests (3.13) (push) Failing after 5s
UI Tests / ui-tests (22) (push) Successful in 54s

This commit is contained in:
Ashwin Bharambe 2025-10-31 11:22:01 -07:00
parent 5f95c1f8cc
commit c2fd17474e

View file

@ -23,7 +23,7 @@ COLLECT_ONLY=false
# Function to display usage # Function to display usage
usage() { usage() {
cat << EOF cat <<EOF
Usage: $0 [OPTIONS] Usage: $0 [OPTIONS]
Options: Options:
@ -62,47 +62,46 @@ EOF
# Parse command line arguments # Parse command line arguments
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
--stack-config) --stack-config)
STACK_CONFIG="$2" STACK_CONFIG="$2"
shift 2 shift 2
;; ;;
--setup) --setup)
TEST_SETUP="$2" TEST_SETUP="$2"
shift 2 shift 2
;; ;;
--subdirs) --subdirs)
TEST_SUBDIRS="$2" TEST_SUBDIRS="$2"
shift 2 shift 2
;; ;;
--suite) --suite)
TEST_SUITE="$2" TEST_SUITE="$2"
shift 2 shift 2
;; ;;
--inference-mode) --inference-mode)
INFERENCE_MODE="$2" INFERENCE_MODE="$2"
shift 2 shift 2
;; ;;
--pattern) --pattern)
TEST_PATTERN="$2" TEST_PATTERN="$2"
shift 2 shift 2
;; ;;
--collect-only) --collect-only)
COLLECT_ONLY=true COLLECT_ONLY=true
shift shift
;; ;;
--help) --help)
usage usage
exit 0 exit 0
;; ;;
*) *)
echo "Unknown option: $1" echo "Unknown option: $1"
usage usage
exit 1 exit 1
;; ;;
esac esac
done done
# Validate required parameters # Validate required parameters
if [[ -z "$STACK_CONFIG" && "$COLLECT_ONLY" == false ]]; then if [[ -z "$STACK_CONFIG" && "$COLLECT_ONLY" == false ]]; then
echo "Error: --stack-config is required" echo "Error: --stack-config is required"
@ -177,12 +176,12 @@ cd $ROOT_DIR
# check if "llama" and "pytest" are available. this script does not use `uv run` given # check if "llama" and "pytest" are available. this script does not use `uv run` given
# it can be used in a pre-release environment where we have not been able to tell # it can be used in a pre-release environment where we have not been able to tell
# uv about pre-release dependencies properly (yet). # uv about pre-release dependencies properly (yet).
if [[ "$COLLECT_ONLY" == false ]] && ! command -v llama &> /dev/null; then if [[ "$COLLECT_ONLY" == false ]] && ! command -v llama &>/dev/null; then
echo "llama could not be found, ensure llama-stack is installed" echo "llama could not be found, ensure llama-stack is installed"
exit 1 exit 1
fi fi
if ! command -v pytest &> /dev/null; then if ! command -v pytest &>/dev/null; then
echo "pytest could not be found, ensure pytest is installed" echo "pytest could not be found, ensure pytest is installed"
exit 1 exit 1
fi fi
@ -219,7 +218,7 @@ if [[ "$STACK_CONFIG" == *"server:"* && "$COLLECT_ONLY" == false ]]; then
# remove "server:" from STACK_CONFIG # remove "server:" from STACK_CONFIG
stack_config=$(echo "$STACK_CONFIG" | sed 's/^server://') stack_config=$(echo "$STACK_CONFIG" | sed 's/^server://')
nohup llama stack run $stack_config > server.log 2>&1 & nohup llama stack run $stack_config >server.log 2>&1 &
echo "Waiting for Llama Stack Server to start..." echo "Waiting for Llama Stack Server to start..."
for i in {1..30}; do for i in {1..30}; do
@ -248,7 +247,7 @@ if [[ "$STACK_CONFIG" == *"docker:"* && "$COLLECT_ONLY" == false ]]; then
container_name="llama-stack-test-$DISTRO" container_name="llama-stack-test-$DISTRO"
if docker ps -a --format '{{.Names}}' | grep -q "^${container_name}$"; then if docker ps -a --format '{{.Names}}' | grep -q "^${container_name}$"; then
echo "Dumping container logs before stopping..." echo "Dumping container logs before stopping..."
docker logs "$container_name" > "docker-${DISTRO}-${INFERENCE_MODE}.log" 2>&1 || true docker logs "$container_name" >"docker-${DISTRO}-${INFERENCE_MODE}.log" 2>&1 || true
echo "Stopping and removing container: $container_name" echo "Stopping and removing container: $container_name"
docker stop "$container_name" 2>/dev/null || true docker stop "$container_name" 2>/dev/null || true
docker rm "$container_name" 2>/dev/null || true docker rm "$container_name" 2>/dev/null || true
@ -437,17 +436,13 @@ elif [ $exit_code -eq 5 ]; then
else else
echo "❌ Tests failed" echo "❌ Tests failed"
echo "" echo ""
echo "=== Dumping last 100 lines of logs for debugging ==="
# Output server or container logs based on stack config # Output server or container logs based on stack config
if [[ "$STACK_CONFIG" == *"server:"* && -f "server.log" ]]; then if [[ "$STACK_CONFIG" == *"server:"* && -f "server.log" ]]; then
echo "--- Last 100 lines of server.log ---" echo "--- Server side failures can be located inside server.log (available from artifacts on CI) ---"
tail -100 server.log
elif [[ "$STACK_CONFIG" == *"docker:"* ]]; then elif [[ "$STACK_CONFIG" == *"docker:"* ]]; then
docker_log_file="docker-${DISTRO}-${INFERENCE_MODE}.log" docker_log_file="docker-${DISTRO}-${INFERENCE_MODE}.log"
if [[ -f "$docker_log_file" ]]; then if [[ -f "$docker_log_file" ]]; then
echo "--- Last 100 lines of $docker_log_file ---" echo "--- Server side failures can be located inside $docker_log_file (available from artifacts on CI) ---"
tail -100 "$docker_log_file"
fi fi
fi fi