48 lines
1.4 KiB
Bash
Executable File
48 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
# Quick Test Script - Validates fixes are working
|
|
|
|
set -e
|
|
|
|
echo "========================================="
|
|
echo "MEV Bot Quick Test"
|
|
echo "========================================="
|
|
|
|
# Run pre-validation
|
|
echo "[1/3] Running pre-run validation..."
|
|
./scripts/pre-run-validation.sh
|
|
|
|
# Build
|
|
echo "[2/3] Building..."
|
|
make build 2>&1 | tail -10
|
|
|
|
# Run for 30 seconds
|
|
echo "[3/3] Running bot for 30 seconds..."
|
|
timeout 30 ./mev-bot start 2>&1 | tee test-run.log || true
|
|
|
|
echo ""
|
|
echo "========================================="
|
|
echo "Analyzing Test Run..."
|
|
echo "========================================="
|
|
|
|
# Check for critical errors
|
|
WSS_ERRORS=$(grep -c "unsupported protocol scheme" test-run.log 2>/dev/null || echo 0)
|
|
ZERO_ADDR=$(grep -c "0x00000000000000000000000000000000000000000" test-run.log 2>/dev/null || echo 0)
|
|
RATE_LIMITS=$(grep -c "Too Many Requests" test-run.log 2>/dev/null || echo 0)
|
|
|
|
echo "WebSocket errors: $WSS_ERRORS"
|
|
echo "Zero addresses: $ZERO_ADDR"
|
|
echo "Rate limit errors: $RATE_LIMITS"
|
|
|
|
if [ "$WSS_ERRORS" -eq 0 ] && [ "$ZERO_ADDR" -lt 10 ] && [ "$RATE_LIMITS" -lt 10 ]; then
|
|
echo ""
|
|
echo "✅ TEST PASSED - Fixes appear to be working"
|
|
exit 0
|
|
else
|
|
echo ""
|
|
echo "⚠️ TEST WARNINGS - Some issues remain:"
|
|
[ "$WSS_ERRORS" -gt 0 ] && echo " - WebSocket errors still present"
|
|
[ "$ZERO_ADDR" -ge 10 ] && echo " - High zero address count"
|
|
[ "$RATE_LIMITS" -ge 10 ] && echo " - Rate limiting issues"
|
|
exit 1
|
|
fi
|