run-test-verbose.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. # Run a test with full conversation output
  3. # Usage: ./run-test-verbose.sh <agent> <pattern>
  4. # Example: ./run-test-verbose.sh opencoder "planning/*.yaml"
  5. AGENT=${1:-opencoder}
  6. PATTERN=${2:-"**/*.yaml"}
  7. echo "🚀 Running test with verbose output..."
  8. echo "Agent: $AGENT"
  9. echo "Pattern: $PATTERN"
  10. echo ""
  11. # Run test with debug mode and capture session ID
  12. SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
  13. OUTPUT=$(pnpm --dir "$SCRIPT_DIR/.." run eval:sdk -- --agent="$AGENT" --pattern="$PATTERN" --debug 2>&1)
  14. # Extract session ID from output
  15. SESSION_ID=$(echo "$OUTPUT" | grep -o "Session created: ses_[a-zA-Z0-9]*" | head -1 | cut -d' ' -f3)
  16. # Show test summary
  17. echo "$OUTPUT" | grep -A 20 "TEST RESULTS"
  18. if [ -n "$SESSION_ID" ]; then
  19. echo ""
  20. echo "========================================================================"
  21. echo "FULL CONVERSATION"
  22. echo "========================================================================"
  23. echo ""
  24. # Show full conversation
  25. "$SCRIPT_DIR/debug/show-test-conversation.sh" "$SESSION_ID"
  26. else
  27. echo ""
  28. echo "⚠️ No session ID found. Test may have failed to start."
  29. echo ""
  30. echo "Full output:"
  31. echo "$OUTPUT"
  32. fi