Files
t66_langmem/scripts/test.sh
Docker Config Backup f0db3e5546 Clean and organize project structure
Major reorganization:
- Created scripts/ directory for all utility scripts
- Created config/ directory for configuration files
- Moved all test files to tests/ directory
- Updated all script paths to work with new structure
- Updated README.md with new project structure diagram

New structure:
├── src/          # Source code (API + MCP)
├── scripts/      # Utility scripts (start-*.sh, docs_server.py, etc.)
├── tests/        # All test files and debug utilities
├── config/       # Configuration files (JSON, Caddy config)
├── docs/         # Documentation website
└── logs/         # Log files

All scripts updated to use relative paths from project root.
Documentation updated with new folder structure.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17 14:11:08 +02:00

59 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# LangMem Test Runner Script
set -e
echo "🧪 Running LangMem API Tests"
# Change to project root
cd "$(dirname "$0")/.."
# Check if services are running
if ! curl -s http://localhost:8765/health > /dev/null; then
echo "❌ LangMem API is not running. Please start with ./scripts/start-dev.sh first."
exit 1
fi
# Install test dependencies
echo "📦 Installing test dependencies..."
pip install -r tests/requirements.txt
# Run different test suites based on argument
case "${1:-all}" in
"unit")
echo "🔬 Running unit tests..."
python -m pytest tests/test_api.py -v -m "not integration"
;;
"integration")
echo "🔗 Running integration tests..."
python -m pytest tests/test_integration.py -v -m "integration"
;;
"all")
echo "🎯 Running all tests..."
python -m pytest tests/ -v
;;
"quick")
echo "⚡ Running quick tests..."
python -m pytest tests/ -v -m "not slow"
;;
"coverage")
echo "📊 Running tests with coverage..."
python -m pytest tests/ -v --cov=src --cov-report=html --cov-report=term
;;
*)
echo "❌ Unknown test type: $1"
echo "Usage: ./scripts/test.sh [unit|integration|all|quick|coverage]"
exit 1
;;
esac
echo ""
echo "✅ Tests completed!"
# Show service logs if tests failed
if [ $? -ne 0 ]; then
echo ""
echo "❌ Tests failed. Showing recent API logs:"
docker-compose logs --tail=50 langmem-api
fi