gitgram/aitimemachine/pal-mcp-server/run_integration_tests.sh
caelum0x 49b183818c Unify gitgram + aitimemachine into the monorepo (de-submodule) and merge vendored engines
Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as
opaque submodule gitlinks on GitHub) into fully-tracked first-party content.

AITM now merges its 7 vendored repos as first-party engines:
- memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts
- git: vendored C git (bundled binary) + gitnexus (in-process code intelligence)
- agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess)

Includes the full session's product build: Gitgram web/mobile/backend features,
AITM website/CLI/MCP, the unified memory layer, engine build tooling
(scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md),
and extensive test suites.

Build artifacts, node_modules, external/, and gemini-cli are gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:14:09 +03:00

90 lines
2.6 KiB
Bash
Executable File

#!/bin/bash
# PAL MCP Server - Run Integration Tests
# This script runs integration tests that require API keys
# Run this locally on your Mac to ensure everything works end-to-end
set -e # Exit on any error
echo "๐Ÿงช Running Integration Tests for PAL MCP Server"
echo "=============================================="
echo "These tests use real API calls with your configured keys"
echo ""
# Activate virtual environment
if [[ -f ".pal_venv/bin/activate" ]]; then
source .pal_venv/bin/activate
echo "โœ… Using virtual environment"
else
echo "โŒ No virtual environment found!"
echo "Please run: ./run-server.sh first"
exit 1
fi
# Check for .env file
if [[ ! -f ".env" ]]; then
echo "โš ๏ธ Warning: No .env file found. Integration tests may fail without API keys."
echo ""
fi
echo "๐Ÿ”‘ Checking API key availability:"
echo "---------------------------------"
# Check which API keys are available
if [[ -n "$GEMINI_API_KEY" ]] || grep -q "GEMINI_API_KEY=" .env 2>/dev/null; then
echo "โœ… GEMINI_API_KEY configured"
else
echo "โŒ GEMINI_API_KEY not found"
fi
if [[ -n "$OPENAI_API_KEY" ]] || grep -q "OPENAI_API_KEY=" .env 2>/dev/null; then
echo "โœ… OPENAI_API_KEY configured"
else
echo "โŒ OPENAI_API_KEY not found"
fi
if [[ -n "$XAI_API_KEY" ]] || grep -q "XAI_API_KEY=" .env 2>/dev/null; then
echo "โœ… XAI_API_KEY configured"
else
echo "โŒ XAI_API_KEY not found"
fi
if [[ -n "$OPENROUTER_API_KEY" ]] || grep -q "OPENROUTER_API_KEY=" .env 2>/dev/null; then
echo "โœ… OPENROUTER_API_KEY configured"
else
echo "โŒ OPENROUTER_API_KEY not found"
fi
if [[ -n "$CUSTOM_API_URL" ]] || grep -q "CUSTOM_API_URL=" .env 2>/dev/null; then
echo "โœ… CUSTOM_API_URL configured (local models)"
else
echo "โŒ CUSTOM_API_URL not found"
fi
echo ""
# Run integration tests
echo "๐Ÿƒ Running integration tests..."
echo "------------------------------"
# Run only integration tests (marked with @pytest.mark.integration)
python -m pytest tests/ -v -m "integration" --tb=short
echo ""
echo "โœ… Integration tests completed!"
echo ""
# Also run simulator tests if requested
if [[ "$1" == "--with-simulator" ]]; then
echo "๐Ÿค– Running simulator tests..."
echo "----------------------------"
python communication_simulator_test.py --verbose
echo ""
echo "โœ… Simulator tests completed!"
fi
echo "๐Ÿ’ก Tips:"
echo "- Run './run_integration_tests.sh' for integration tests only"
echo "- Run './run_integration_tests.sh --with-simulator' to also run simulator tests"
echo "- Run './code_quality_checks.sh' for unit tests and linting"
echo "- Check logs in logs/mcp_server.log if tests fail"