Files
poimen-memory/run_production_test.sh
T

82 lines
2.2 KiB
Bash
Raw Normal View History

#!/bin/bash
# Master script: Run full production ingest test with logging
#
# Usage:
# ./run_production_test.sh
# ./run_production_test.sh [api-key]
#
# What it does:
# 1. Collect baseline logs
# 2. Run ingest test
# 3. Collect post-test logs
# 4. Analyze for errors
# 5. Display results
set -e
API_KEY="${1:-test-key}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo ""
echo "╔═════════════════════════════════════════╗"
echo "║ Production Ingest Test with api-gw ║"
echo "║ (Full root-cause error logging) ║"
echo "╚═════════════════════════════════════════╝"
echo ""
# Verify scripts exist
for script in test_production_ingest.sh collect_prod_logs.sh; do
if [ ! -f "$SCRIPT_DIR/$script" ]; then
echo "✗ Missing: $script"
exit 1
fi
done
echo "Step 1: Collecting baseline logs..."
"$SCRIPT_DIR/collect_prod_logs.sh" before
echo ""
echo "Step 2: Running ingest test..."
echo " (Sending records through embedding pipeline to api-gw)"
echo ""
if MEM_API_KEY="$API_KEY" "$SCRIPT_DIR/test_production_ingest.sh"; then
echo ""
echo "✓ Test passed!"
test_status=0
else
echo ""
echo "✗ Test failed!"
test_status=1
fi
echo ""
echo "Step 3: Collecting post-test logs..."
"$SCRIPT_DIR/collect_prod_logs.sh" after
echo ""
echo "Step 4: Analyzing logs for errors..."
echo ""
"$SCRIPT_DIR/collect_prod_logs.sh" analyze
echo ""
echo "════════════════════════════════════════"
if [ $test_status -eq 0 ]; then
echo "✓ INGEST TEST PASSED"
else
echo "✗ INGEST TEST FAILED"
echo ""
echo "Next steps:"
echo " 1. Check logs in prod_logs_*/ directory"
echo " 2. Look for errors in:"
echo " - /memory/ingest endpoint response"
echo " - Embedding service (LLM_ENDPOINT)"
echo " - api-gw gateway logs"
echo " - Database connection"
fi
echo "════════════════════════════════════════"
echo ""
exit $test_status