Add comprehensive Docker test environment for installation validation

Add complete Docker testing infrastructure to validate all 3 installation methods

Features:
- Dockerfile: Ubuntu 22.04 with Node.js 20, Python 3, prerequisites
- docker-compose.yml: Orchestrate 3 test containers + verification
- Test suite with 5 scripts:
  * common.sh: Shared utilities and verification functions
  * test-interactive-install.sh: Test Option 2 (interactive installer)
  * test-master-prompt-install.sh: Test Option 1 (master prompt)
  * test-manual-install.sh: Test Option 3 (manual installation)
  * verify-all-installations.sh: Master verification with report generation
- run-tests.sh: Quick start script for easy test execution

What Gets Tested:
✓ Prerequisites (Node.js, npm, Python, Git, jq)
✓ Claude Code installation and version
✓ Settings files (settings.json, settings.local.json)
✓ 38 agents across 8 departments
✓ MCP tools (@z_ai/mcp-server, @z_ai/coding-helper, llm-tldr)
✓ UI/UX Pro Max skill
✓ Ralph CLI (optional, can be enabled)

Test Results:
- Saved to docker/test-env/test-results/
- Detailed logs for each test method
- Component verification counts
- Comprehensive final report with pass/fail status

Usage:
cd docker/test-env
./run-tests.sh

Or manually:
docker-compose up verify-all

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
uroma
2026-01-16 10:30:54 +00:00
Unverified
parent fd6dcca2f7
commit 699087342f
9 changed files with 1418 additions and 0 deletions

93
docker/test-env/run-tests.sh Executable file
View File

@@ -0,0 +1,93 @@
#!/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