#!/bin/bash # End-to-end test for tfcode sync set -e echo "========================================" echo "tfcode Sync End-to-End Test" echo "========================================" echo # Step 1: Check Python echo "Step 1: Checking Python environment..." if ! command -v python3 &> /dev/null; then echo "✗ Python 3 not found" exit 1 fi echo "✓ Python found: $(python3 --version)" echo # Step 2: Install dependencies echo "Step 2: Installing Python dependencies..." cd packages/tf-sync pip install -e . -q 2>/dev/null || pip install toothfairyai pydantic httpx rich -q echo "✓ Dependencies installed" cd ../.. echo # Step 3: Run Python test echo "Step 3: Running Python sync test..." python3 scripts/test-sync.py echo # Step 4: Test CLI (if bun available) if command -v bun &> /dev/null; then echo "Step 4: Testing CLI commands..." echo cd packages/tfcode echo "4a. Testing validate command..." bun run src/index.ts validate echo echo "4b. Testing sync command..." bun run src/index.ts sync echo echo "4c. Testing tools list command..." bun run src/index.ts tools list echo cd ../.. else echo "Step 4: Skipping CLI test (bun not available)" fi echo echo "========================================" echo "All tests passed!" echo "========================================"