brainy/fix-clear-in-tests.sh
David Snelling 4949b6a629 CHECKPOINT: Industry-standard 3-tier testing implemented
 MAJOR BREAKTHROUGH - Session 5 Success:
- Unit tests: 18/19 passing with mocked AI (<500MB RAM)
- Integration tests: Real AI models loading successfully
- Core features: Real embeddings, CRUD operations verified
- Architecture: All 11 augmentations, worker threads operational

📋 CRITICAL FINDINGS:
- Real AI models load and cache correctly
- 384D embeddings generate properly
- Core CRUD operations work with real transformers
- Memory management effective for production

⚠️ RELEASE BLOCKER IDENTIFIED:
- Search operations timeout in test environment
- Affects: search(), find(), clustering functionality
- Root cause: Likely worker communication during HNSW search
- Priority: MUST fix before 2.0.0 release

🎯 NEXT SESSION PRIORITIES:
1. Debug and fix search timeout issue
2. Verify search/find/clustering work in production
3. Final documentation cleanup
4. Release preparation

Confidence: 90% ready (pending search functionality verification)
2025-08-25 17:12:58 -07:00

20 lines
No EOL
672 B
Bash
Executable file

#!/bin/bash
# Fix all .clear() calls to .clearAll({ force: true }) in tests
echo "🔧 Fixing clear() calls in test files..."
# Find and replace in all test files
for file in tests/*.test.ts; do
if grep -q "\.clear()" "$file"; then
echo " Fixing: $file"
# Replace various patterns
sed -i 's/\.clear()/\.clearAll({ force: true })/g' "$file"
sed -i 's/\.clearAll({ force: true }) \/\/ Clear any existing data/\.clearAll({ force: true }) \/\/ Clear any existing data/g' "$file"
fi
done
echo "✅ Fixed all clear() calls to clearAll({ force: true })"
echo ""
echo "Files modified:"
grep -l "clearAll({ force: true })" tests/*.test.ts | sed 's/^/ - /'