Files
claude-code-glm-suite/docker/test-env/test-suite/test-interactive-install.sh
uroma 699087342f 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>
2026-01-16 10:30:54 +00:00

144 lines
3.1 KiB
Bash
Executable File

#!/bin/bash
# Test Option 2: Interactive Installer
# This script tests the interactive installer in automated mode
set -e
# Source common functions
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/common.sh"
log_section "Testing Option 2: Interactive Installer"
TEST_NAME="interactive-install"
REPO_DIR="$HOME/claude-code-glm-suite"
INSTALLER_SCRIPT="$REPO_DIR/interactive-install-claude.sh"
# Check if repo is available
if [ ! -d "$REPO_DIR" ]; then
log_error "Repository not found at $REPO_DIR"
exit 1
fi
log_info "Repository found: $REPO_DIR"
# Check if installer exists
if [ ! -f "$INSTALLER_SCRIPT" ]; then
log_error "Installer not found: $INSTALLER_SCRIPT"
exit 1
fi
log_info "Installer found: $INSTALLER_SCRIPT"
# Make installer executable
chmod +x "$INSTALLER_SCRIPT"
# 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
# Run installer with automatic responses
log_section "Running Interactive Installer (Automated Mode)"
# Create expect script for automated responses
cat > /tmp/installer-answers.exp << 'EXPECT_EOF'
#!/usr/bin/expect -f
set timeout 300
spawn /home/testuser/claude-code-glm-suite/interactive-install-claude.sh
# Model selection
expect "Select model provider:"
send "1\r"
# Agent categories (select all)
expect "Select agent categories"
expect "Select engineering agents?"
send "Y\r"
expect "Select marketing agents?"
send "Y\r"
expect "Select product agents?"
send "Y\r"
expect "Select studio-operations agents?"
send "Y\r"
expect "Select project-management agents?"
send "Y\r"
expect "Select testing agents?"
send "Y\r"
expect "Select design agents?"
send "Y\r"
expect "Select bonus agents?"
send "Y\r"
# MCP tools
expect "Install vision tools?"
send "Y\r"
expect "Install web tools?"
send "Y\r"
expect "Install GitHub tools?"
send "Y\r"
expect "Install TLDR?"
send "Y\r"
# Plugins
expect "Install plugins?"
send "Y\r"
# Hooks
expect "Install hooks?"
send "Y\r"
# Ralph CLI (optional - skip for this test to keep it simple)
expect "Install Ralph CLI?"
send "N\r"
# Prerequisites check
expect "Prerequisites check passed"
# Installation
expect "Installation completed"
# Summary
expect "Installation Summary"
# Don't launch Claude Code
expect "Launch Claude Code now?"
send "N\r"
expect eof
EXPECT_EOF
chmod +x /tmp/installer-answers.exp
# Run the expect script
log_info "Starting automated installation..."
if expect /tmp/installer-answers.exp >> "$LOG_FILE" 2>&1; then
log_success "Installer completed successfully"
else
log_error "Installer failed with exit code $?"
fi
# Verify installation
log_section "Verifying Installation"
run_full_verification
# Save results
save_results "$TEST_NAME"
# Cleanup
rm -f /tmp/installer-answers.exp
# 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 "Interactive Installer Test Complete"
echo ""