#!/bin/bash # Quick start script for running Docker tests # This script builds and runs all installation tests set -e # Colors RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' CYAN='\033[0;36m' BOLD='\033[1m' NC='\033[0m' echo -e "${CYAN}╔════════════════════════════════════════════════════════════════╗${NC}" echo -e "${CYAN}║ Claude Code Suite - Docker Test Environment ║${NC}" echo -e "${CYAN}╚════════════════════════════════════════════════════════════════╝${NC}" echo "" # Check if Docker is installed if ! command -v docker &> /dev/null; then echo -e "${RED}Error: Docker is not installed${NC}" echo "Please install Docker first: https://docs.docker.com/get-docker/" exit 1 fi # Check if docker-compose is installed if ! command -v docker-compose &> /dev/null; then echo -e "${YELLOW}Warning: docker-compose not found, trying docker compose...${NC}" DOCKER_COMPOSE="docker compose" else DOCKER_COMPOSE="docker-compose" fi # Change to test directory cd "$(dirname "$0")" echo -e "${BOLD}📦 This will:${NC}" echo " 1. Build Docker test environment" echo " 2. Run all 3 installation tests" echo " 3. Generate comprehensive test report" echo "" # Ask for confirmation read -p "Continue? (y/N): " confirm if [[ ! "$confirm" =~ ^[Yy]$ ]]; then echo "Aborted." exit 0 fi echo "" echo -e "${BLUE}Building Docker test environment...${NC}" # Build the Docker image if $DOCKER_COMPOSE build; then echo -e "${GREEN}✓ Build successful${NC}" else echo -e "${RED}✗ Build failed${NC}" exit 1 fi echo "" echo -e "${BLUE}Running installation tests...${NC}" echo "This may take 10-15 minutes..." echo "" # Run the tests if $DOCKER_COMPOSE run --rm verify-all; then echo "" echo -e "${GREEN}╔════════════════════════════════════════════════════════════════╗${NC}" echo -e "${GREEN}║ ✅ ALL TESTS PASSED ✅ ║${NC}" echo -e "${GREEN}╚════════════════════════════════════════════════════════════════╝${NC}" echo "" echo -e "${BOLD}📊 Test Report:${NC}" echo " Location: $(pwd)/test-results/" echo "" ls -lh test-results/final-report-*.txt 2>/dev/null || echo " (Run tests first to generate report)" echo "" else echo "" echo -e "${RED}╔════════════════════════════════════════════════════════════════╗${NC}" echo -e "${RED}║ ❌ SOME TESTS FAILED ❌ ║${NC}" echo -e "${RED}╚════════════════════════════════════════════════════════════════╝${NC}" echo "" echo -e "${BOLD}📊 Check logs:${NC}" echo " Location: $(pwd)/test-results/" echo "" echo " View detailed logs:" echo " cat test-results/test-*.log" echo "" exit 1 fi