brainy/tests/scripts/test-all-with-memory.sh
David Snelling b74faa85d4 CHECKPOINT: Major project cleanup and organization
🎯 CLEANUP MILESTONE - Session 5 Continuation:

📁 DOCUMENTATION (70+ → 31 files):
 Removed 14 redundant API design documents
 Removed 8 augmentation archive documents
 Removed 6 planning documents
 Removed 11 temporary strategy/optimization docs
 All backed up to backup-cleanup-2025-08-26/

📂 TEST ORGANIZATION:
 Moved 17 test files → tests/manual-tests/
 Moved 2 vitest configs → tests/configs/
 Moved 5 test scripts → tests/scripts/
 Removed 12 log files (backed up)

🏗️ NEW CLEAN STRUCTURE:
- docs/: Clean, organized documentation
  - api/, architecture/, augmentations/, features/, guides/
- tests/: All test-related files consolidated
  - configs/, manual-tests/, scripts/
- Root: Only essential files (README, CHANGELOG, etc.)

📊 IMPACT:
- 70% reduction in documentation clutter
- 100% of tests organized under tests/
- Professional structure ready for 2.0 release
- No data loss - everything backed up

Ready for final release preparation!
2025-08-26 08:07:41 -07:00

73 lines
No EOL
2 KiB
Bash
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Comprehensive test runner with proper memory management
# Runs ALL tests with adequate memory allocation
echo "🧠 Brainy 2.0 Complete Test Suite with Memory Management"
echo "========================================================="
echo ""
# Set environment for ALL tests
export NODE_OPTIONS='--max-old-space-size=16384'
export BRAINY_MODELS_PATH=./models
export BRAINY_ALLOW_REMOTE_MODELS=false
# Use our memory-optimized vitest config
export VITEST_CONFIG=./vitest.config.memory.ts
echo "📊 Configuration:"
echo " - Node heap: 16GB"
echo " - Models: Local only"
echo " - Tests: Sequential execution"
echo " - Timeout: 2 minutes per test"
echo ""
# Build first
echo "🔨 Building TypeScript..."
npm run build
if [ $? -ne 0 ]; then
echo "❌ Build failed! Fix TypeScript errors first."
exit 1
fi
echo "✅ Build successful"
echo ""
# Run all tests with memory config
echo "🧪 Running all tests..."
npm test -- --config ./vitest.config.memory.ts --reporter=verbose 2>&1 | tee full-test-output.log
# Extract summary
echo ""
echo "=========================================="
echo "📊 Test Summary"
echo "=========================================="
# Count results
PASSED=$(grep -c "✓" full-test-output.log 2>/dev/null || echo 0)
FAILED=$(grep -c "×" full-test-output.log 2>/dev/null || echo 0)
SKIPPED=$(grep -c "↓" full-test-output.log 2>/dev/null || echo 0)
echo "✅ Passed: $PASSED"
echo "❌ Failed: $FAILED"
echo "⏭️ Skipped: $SKIPPED"
echo "📊 Total: $((PASSED + FAILED + SKIPPED))"
echo ""
if [ $FAILED -eq 0 ]; then
echo "🎉 SUCCESS! All tests passed!"
echo ""
echo "Ready for release:"
echo " npm version patch"
echo " npm publish"
exit 0
else
echo "⚠️ $FAILED tests failed."
echo ""
echo "Common issues:"
echo "1. Out of memory → Increase NODE_OPTIONS"
echo "2. Timeout → Tests need more than 2 minutes"
echo "3. clearAll → Must use { force: true }"
echo ""
echo "Check full-test-output.log for details."
exit 1
fi