mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-12 04:00:42 +00:00
fix(ci): dump server/container logs when tests fail
Output last 100 lines of server.log or docker container logs when integration tests fail to aid debugging.
This commit is contained in:
parent
5aaf1a8bca
commit
ef08ebff30
1 changed files with 15 additions and 0 deletions
|
|
@ -410,6 +410,21 @@ elif [ $exit_code -eq 5 ]; then
|
||||||
echo "⚠️ No tests collected (pattern matched no tests)"
|
echo "⚠️ No tests collected (pattern matched no tests)"
|
||||||
else
|
else
|
||||||
echo "❌ Tests failed"
|
echo "❌ Tests failed"
|
||||||
|
echo ""
|
||||||
|
echo "=== Dumping last 100 lines of logs for debugging ==="
|
||||||
|
|
||||||
|
# Output server or container logs based on stack config
|
||||||
|
if [[ "$STACK_CONFIG" == *"server:"* && -f "server.log" ]]; then
|
||||||
|
echo "--- Last 100 lines of server.log ---"
|
||||||
|
tail -100 server.log
|
||||||
|
elif [[ "$STACK_CONFIG" == *"docker:"* ]]; then
|
||||||
|
container_name="llama-stack-test-$DISTRO"
|
||||||
|
if docker ps -a --format '{{.Names}}' | grep -q "^${container_name}$"; then
|
||||||
|
echo "--- Last 100 lines of docker logs for $container_name ---"
|
||||||
|
docker logs "$container_name" 2>&1 | tail -100
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue