mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
fix(docker): override entrypoint in test script to avoid interactive mode
Add --entrypoint sh flag to docker-compose run commands in test script to bypass picoclaw agent's interactive mode. This allows direct command execution for testing MCP tools. Changes: - Add --entrypoint sh to all docker-compose run commands - Use SERVICE variable for better maintainability - Simplify command syntax: sh -c 'cmd' → -c 'cmd'
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
set -e
|
||||
|
||||
COMPOSE_FILE="docker-compose.full.yml"
|
||||
SERVICE="picoclaw-agent"
|
||||
|
||||
echo "🧪 Testing MCP tools in Docker container (full-featured image)..."
|
||||
echo ""
|
||||
@@ -14,31 +15,31 @@ docker-compose -f "$COMPOSE_FILE" build
|
||||
|
||||
# Test npx
|
||||
echo "✅ Testing npx..."
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm picoclaw-agent sh -c 'npx --version'
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm --entrypoint sh "$SERVICE" -c 'npx --version'
|
||||
|
||||
# Test npm
|
||||
echo "✅ Testing npm..."
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm picoclaw-agent sh -c 'npm --version'
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm --entrypoint sh "$SERVICE" -c 'npm --version'
|
||||
|
||||
# Test node
|
||||
echo "✅ Testing Node.js..."
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm picoclaw-agent sh -c 'node --version'
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm --entrypoint sh "$SERVICE" -c 'node --version'
|
||||
|
||||
# Test git
|
||||
echo "✅ Testing git..."
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm picoclaw-agent sh -c 'git --version'
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm --entrypoint sh "$SERVICE" -c 'git --version'
|
||||
|
||||
# Test python
|
||||
echo "✅ Testing Python..."
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm picoclaw-agent sh -c 'python3 --version'
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm --entrypoint sh "$SERVICE" -c 'python3 --version'
|
||||
|
||||
# Test uv
|
||||
echo "✅ Testing uv..."
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm picoclaw-agent sh -c 'uv --version'
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm --entrypoint sh "$SERVICE" -c 'uv --version'
|
||||
|
||||
# Test MCP server installation (quick)
|
||||
echo "✅ Testing MCP server install with npx..."
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm picoclaw-agent sh -c 'npx -y cowsay "MCP works!"'
|
||||
docker-compose -f "$COMPOSE_FILE" run --rm --entrypoint sh "$SERVICE" -c 'npx -y cowsay "MCP works!"'
|
||||
|
||||
echo ""
|
||||
echo "🎉 All MCP tools are working correctly!"
|
||||
|
||||
Reference in New Issue
Block a user