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
+8 -7
View File
@@ -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!"