railyard/apps/ritgram/test-github.sh
caelum0x f80b04ae0f feat(ritgram): move GitGram app into railyard as Ritgram, next to Rithub
Moved later/gitgram-ai/gitgram/ to apps/ritgram/ (fresh history; full history stays in caelum0x/gitgram).
AITimeMachine stays separate in later/gitgram-ai per the Rithub master plan.
Logs, pid files and env files are ignored; GPL-3.0 mobile/proximity noted in THIRD_PARTY_NOTICES.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 04:18:46 +03:00

63 lines
1.7 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
echo "🧪 Testing GitHub Integration"
echo "============================="
echo ""
# Check if backend is running
if ! curl -s http://localhost:3001/health > /dev/null 2>&1; then
echo "❌ Backend is not running!"
echo "Start it with: cd backend && npm run dev"
exit 1
fi
echo "✅ Backend is running"
echo ""
echo "1️⃣ Testing Repository Search"
echo "----------------------------"
echo "Searching for 'vscode'..."
echo ""
response=$(curl -s "http://localhost:3001/api/repositories/search?q=vscode")
echo "$response" | jq '.' 2>/dev/null || echo "$response"
echo ""
echo "2️⃣ Testing Get Repository"
echo "------------------------"
echo "Fetching microsoft/vscode..."
echo ""
response=$(curl -s "http://localhost:3001/api/repositories/microsoft/vscode")
echo "$response" | jq '.' 2>/dev/null || echo "$response"
echo ""
echo "3️⃣ Testing Trending Repositories"
echo "-------------------------------"
echo "Fetching trending TypeScript repos..."
echo ""
response=$(curl -s "http://localhost:3001/api/repositories/trending?language=typescript")
echo "$response" | jq '.' 2>/dev/null || echo "$response"
echo ""
echo "4️⃣ Testing Rate Limit"
echo "--------------------"
echo "Checking GitHub API rate limit..."
echo ""
if [ -n "$GITHUB_TOKEN" ]; then
curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/rate_limit | jq '.rate'
else
curl -s https://api.github.com/rate_limit | jq '.rate'
fi
echo ""
echo "✅ GitHub Integration Tests Complete!"
echo ""
echo "Tips:"
echo " - Add GITHUB_TOKEN to .env for 5000 req/hour"
echo " - Without token: 60 req/hour"
echo " - Get token: https://github.com/settings/tokens"
echo ""