Files
claude-code-glm-suite/docker/test-env/test-suite/test-master-prompt-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

124 lines
3.2 KiB
Bash
Executable File

#!/bin/bash
# Test Option 1: Master Prompt Installation
# This script tests the MASTER-PROMPT installation method
set -e
# Source common functions
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/common.sh"
log_section "Testing Option 1: Master Prompt Installation"
TEST_NAME="master-prompt-install"
REPO_DIR="$HOME/claude-code-glm-suite"
MASTER_PROMPT="$REPO_DIR/MASTER-PROMPT.md"
# Check if repo is available
if [ ! -d "$REPO_DIR" ]; then
log_error "Repository not found at $REPO_DIR"
exit 1
fi
# Check if MASTER-PROMPT exists
if [ ! -f "$MASTER_PROMPT" ]; then
log_error "MASTER-PROMPT.md not found"
exit 1
fi
log_info "MASTER-PROMPT.md found"
# 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
# Extract and execute steps from MASTER-PROMPT
log_section "Executing MASTER-PROMPT Installation Steps"
# Create a script from MASTER-PROMPT instructions
cat > /tmp/master-install-script.sh << 'MASTER_SCRIPT_EOF'
#!/bin/bash
set -e
echo "Step 1: Installing Contains Studio Agents..."
# Clone agents repository
git clone --depth 1 https://github.com/contains-studio/agents.git /tmp/contains-studio-agents
# Copy agents
mkdir -p ~/.claude/agents
cp -r /tmp/contains-studio-agents/agents/* ~/.claude/agents/
echo "Step 2: Installing MCP Tools..."
# Install vision tools (via npx, not global install)
npm install -g @z_ai/mcp-server 2>/dev/null || echo "MCP server already installed"
# Install web tools
npm install -g @z_ai/coding-helper 2>/dev/null || echo "Coding helper already installed"
# Install TLDR
npm install -g llm-tldr 2>/dev/null || echo "TLDR already installed"
echo "Step 3: Installing UI/UX Pro Max Skill..."
git clone --depth 1 https://github.com/nextlevelbuilder/ui-ux-pro-max-skill.git /tmp/ui-ux-skill
mkdir -p ~/.claude/skills
cp -r /tmp/ui-ux-skill/* ~/.claude/skills/
echo "Step 4: Installing Ralph CLI (Optional - skipping for test)"
# Skipping Ralph CLI for this test to keep it simple
echo "Step 5: Creating configuration..."
mkdir -p ~/.claude
# Create basic settings.json
cat > ~/.claude/settings.json << 'EOF'
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "test-token-for-installation-test",
"ANTHROPIC_BASE_URL": "https://api.anthropic.com"
}
}
EOF
echo "Step 6: Verification..."
echo "Installation completed!"
MASTER_SCRIPT_EOF
chmod +x /tmp/master-install-script.sh
# Run the installation script
log_info "Executing installation steps..."
if /tmp/master-install-script.sh >> "$LOG_FILE" 2>&1; then
log_success "Installation steps completed"
else
log_error "Installation failed with exit code $?"
fi
# Verify installation
log_section "Verifying Installation"
run_full_verification
# Save results
save_results "$TEST_NAME"
# Cleanup
rm -f /tmp/master-install-script.sh
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 "Master Prompt Installation Test Complete"
echo ""