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:
149
docker/test-env/test-suite/test-manual-install.sh
Executable file
149
docker/test-env/test-suite/test-manual-install.sh
Executable file
@@ -0,0 +1,149 @@
|
||||
#!/bin/bash
|
||||
# Test Option 3: Manual Installation
|
||||
# This script tests the step-by-step manual installation
|
||||
|
||||
set -e
|
||||
|
||||
# Source common functions
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/common.sh"
|
||||
|
||||
log_section "Testing Option 3: Manual Installation"
|
||||
|
||||
TEST_NAME="manual-install"
|
||||
|
||||
# Backup existing Claude directory if it exists
|
||||
BACKUP_DIR=""
|
||||
if [ -d "$HOME/.claude" ]; then
|
||||
BACKUP_DIR="$HOME/.claude.backup.$(date +%Y%m%d-%H%M%S)"
|
||||
log_info "Backing up existing .claude directory to $BACKUP_DIR"
|
||||
mv "$HOME/.claude" "$BACKUP_DIR"
|
||||
fi
|
||||
|
||||
log_section "Step 1: Prerequisites Check"
|
||||
|
||||
# Verify prerequisites
|
||||
verify_prerequisites
|
||||
|
||||
log_section "Step 2: Configure Claude Code"
|
||||
|
||||
# Create settings.json
|
||||
mkdir -p ~/.claude
|
||||
cat > ~/.claude/settings.json << 'EOF'
|
||||
{
|
||||
"env": {
|
||||
"ANTHROPIC_AUTH_TOKEN": "test-token-for-installation-test",
|
||||
"ANTHROPIC_BASE_URL": "https://api.anthropic.com"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
test_pass "settings.json created"
|
||||
|
||||
log_section "Step 3: Install Agents (38 agents)"
|
||||
|
||||
# Clone agents repository
|
||||
log_info "Cloning contains-studio/agents repository..."
|
||||
if git clone --depth 1 https://github.com/contains-studio/agents.git /tmp/contains-studio-agents >> "$LOG_FILE" 2>&1; then
|
||||
test_pass "Agents repository cloned"
|
||||
else
|
||||
test_fail "Failed to clone agents repository"
|
||||
fi
|
||||
|
||||
# Copy agents
|
||||
log_info "Copying agents to ~/.claude/agents..."
|
||||
mkdir -p ~/.claude/agents
|
||||
if cp -r /tmp/contains-studio-agents/agents/* ~/.claude/agents/ >> "$LOG_FILE" 2>&1; then
|
||||
test_pass "Agents copied successfully"
|
||||
else
|
||||
test_fail "Failed to copy agents"
|
||||
fi
|
||||
|
||||
# Verify agent count
|
||||
AGENT_COUNT=$(find ~/.claude/agents -name "*.md" -type f 2>/dev/null | wc -l)
|
||||
log_info "Found $AGENT_COUNT agent files"
|
||||
|
||||
log_section "Step 4: Install MCP Tools"
|
||||
|
||||
# Install @z_ai/mcp-server
|
||||
log_info "Installing @z_ai/mcp-server..."
|
||||
if npm install -g @z_ai/mcp-server >> "$LOG_FILE" 2>&1; then
|
||||
test_pass "@z_ai/mcp-server installed"
|
||||
else
|
||||
test_warn "@z_ai/mcp-server installation failed (may be already installed)"
|
||||
fi
|
||||
|
||||
# Install @z_ai/coding-helper
|
||||
log_info "Installing @z_ai/coding-helper..."
|
||||
if npm install -g @z_ai/coding-helper >> "$LOG_FILE" 2>&1; then
|
||||
test_pass "@z_ai/coding-helper installed"
|
||||
else
|
||||
test_warn "@z_ai/coding-helper installation failed (may be already installed)"
|
||||
fi
|
||||
|
||||
# Install llm-tldr
|
||||
log_info "Installing llm-tldr..."
|
||||
if npm install -g llm-tldr >> "$LOG_FILE" 2>&1; then
|
||||
test_pass "llm-tldr installed"
|
||||
else
|
||||
test_warn "llm-tldr installation failed (may be already installed)"
|
||||
fi
|
||||
|
||||
log_section "Step 5: Install UI/UX Pro Max Skill"
|
||||
|
||||
log_info "Cloning ui-ux-pro-max-skill repository..."
|
||||
if git clone --depth 1 https://github.com/nextlevelbuilder/ui-ux-pro-max-skill.git /tmp/ui-ux-skill >> "$LOG_FILE" 2>&1; then
|
||||
test_pass "UI/UX Pro Max repository cloned"
|
||||
else
|
||||
test_fail "Failed to clone UI/UX Pro Max repository"
|
||||
fi
|
||||
|
||||
log_info "Copying UI/UX Pro Max skill..."
|
||||
mkdir -p ~/.claude/skills
|
||||
if cp -r /tmp/ui-ux-skill/* ~/.claude/skills/ >> "$LOG_FILE" 2>&1; then
|
||||
test_pass "UI/UX Pro Max skill installed"
|
||||
else
|
||||
test_fail "Failed to copy UI/UX Pro Max skill"
|
||||
fi
|
||||
|
||||
log_section "Step 6: Configure MCP Tools"
|
||||
|
||||
# Create settings.local.json with MCP configuration
|
||||
cat > ~/.claude/settings.local.json << 'EOF'
|
||||
{
|
||||
"mcpServers": {
|
||||
"zai-vision": {
|
||||
"command": "npx",
|
||||
"args": ["@z_ai/mcp-server"]
|
||||
},
|
||||
"zai-web": {
|
||||
"command": "npx",
|
||||
"args": ["@z_ai/coding-helper"]
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
test_pass "settings.local.json created with MCP configuration"
|
||||
|
||||
log_section "Step 7: Verify Installation"
|
||||
|
||||
# Verify installation
|
||||
run_full_verification
|
||||
|
||||
# Save results
|
||||
save_results "$TEST_NAME"
|
||||
|
||||
# Cleanup temporary files
|
||||
rm -rf /tmp/contains-studio-agents
|
||||
rm -rf /tmp/ui-ux-skill
|
||||
|
||||
# Restore backup if test failed
|
||||
if [ $TESTS_FAILED -gt 0 ] && [ -n "$BACKUP_DIR" ]; then
|
||||
log_warning "Test failed, restoring backup"
|
||||
rm -rf "$HOME/.claude"
|
||||
mv "$BACKUP_DIR" "$HOME/.claude"
|
||||
fi
|
||||
|
||||
log_section "Manual Installation Test Complete"
|
||||
echo ""
|
||||
Reference in New Issue
Block a user