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:
yuchou87 2026-02-16 15:49:14 +08:00
parent 51ed54a414
commit b9c2b3555a

View file

@ -4,6 +4,7 @@
set -e set -e
COMPOSE_FILE="docker-compose.full.yml" COMPOSE_FILE="docker-compose.full.yml"
SERVICE="picoclaw-agent"
echo "🧪 Testing MCP tools in Docker container (full-featured image)..." echo "🧪 Testing MCP tools in Docker container (full-featured image)..."
echo "" echo ""
@ -14,31 +15,31 @@ docker-compose -f "$COMPOSE_FILE" build
# Test npx # Test npx
echo "✅ Testing 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 # Test npm
echo "✅ Testing 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 # Test node
echo "✅ Testing Node.js..." 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 # Test git
echo "✅ Testing 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 # Test python
echo "✅ Testing 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 # Test uv
echo "✅ Testing 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) # Test MCP server installation (quick)
echo "✅ Testing MCP server install with npx..." 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 ""
echo "🎉 All MCP tools are working correctly!" echo "🎉 All MCP tools are working correctly!"