#!/bin/bash
# Script to run the historical data test

echo "Starting test environment..."
echo "This will start Kafka, Flink, and the Ingestor services"
echo ""

cd ../..

echo "Step 1: Starting core services (Kafka, Flink, Ingestor)..."
docker-compose up -d zookeeper kafka postgres flink-jobmanager flink-taskmanager ingestor

echo ""
echo "Step 2: Waiting for services to be ready (30 seconds)..."
sleep 30

echo ""
echo "Step 3: Running test client..."
docker-compose --profile test up history-test-client

echo ""
echo "Test complete!"
echo ""
echo "To view logs:"
echo "  docker-compose logs ingestor"
echo "  docker-compose logs flink-jobmanager"
echo ""
echo "To stop all services:"
echo "  docker-compose down"
