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:
211
docker/test-env/README.md
Normal file
211
docker/test-env/README.md
Normal file
@@ -0,0 +1,211 @@
|
||||
# Claude Code Suite - Docker Test Environment
|
||||
|
||||
This Docker environment tests all three installation methods for the Claude Code Suite to ensure error-free, fully working outcomes.
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
```bash
|
||||
# Build the test environment
|
||||
cd docker/test-env
|
||||
docker-compose build
|
||||
|
||||
# Run all tests
|
||||
docker-compose up
|
||||
|
||||
# View results
|
||||
docker-compose run verify-all
|
||||
cat test-results/final-report-*.txt
|
||||
```
|
||||
|
||||
## 📋 What Gets Tested
|
||||
|
||||
### Three Installation Methods:
|
||||
|
||||
1. **Option 1: Master Prompt Installation**
|
||||
- Copies MASTER-PROMPT.md instructions
|
||||
- Executes each step automatically
|
||||
- Verifies all components installed
|
||||
|
||||
2. **Option 2: Interactive Installer**
|
||||
- Runs `interactive-install-claude.sh`
|
||||
- Uses expect script to automate responses
|
||||
- Tests all installation options
|
||||
|
||||
3. **Option 3: Manual Installation**
|
||||
- Executes each step manually
|
||||
- Tests individual commands
|
||||
- Verifies each component separately
|
||||
|
||||
### Components Verified:
|
||||
|
||||
- ✅ **Prerequisites** - Node.js, npm, Python, Git, jq
|
||||
- ✅ **Claude Code** - Installation and version
|
||||
- ✅ **Settings Files** - settings.json, settings.local.json
|
||||
- ✅ **Agents** - 38 agents across 8 departments
|
||||
- ✅ **MCP Tools** - @z_ai/mcp-server, @z_ai/coding-helper, llm-tldr
|
||||
- ✅ **UI/UX Pro Max** - Skill installation
|
||||
- ✅ **Ralph CLI** (Optional) - Hook script and configuration
|
||||
|
||||
## 📁 Test Suite Structure
|
||||
|
||||
```
|
||||
docker/test-env/
|
||||
├── Dockerfile # Base Docker image
|
||||
├── docker-compose.yml # Orchestration of test containers
|
||||
├── README.md # This file
|
||||
└── test-suite/
|
||||
├── common.sh # Shared utilities and verification functions
|
||||
├── test-interactive-install.sh # Test Option 2
|
||||
├── test-master-prompt-install.sh # Test Option 1
|
||||
├── test-manual-install.sh # Test Option 3
|
||||
└── verify-all-installations.sh # Master verification script
|
||||
```
|
||||
|
||||
## 🔧 Running Individual Tests
|
||||
|
||||
### Test Interactive Installer Only:
|
||||
|
||||
```bash
|
||||
docker-compose run --rm test-interactive
|
||||
```
|
||||
|
||||
### Test Master Prompt Only:
|
||||
|
||||
```bash
|
||||
docker-compose run --rm test-master-prompt
|
||||
```
|
||||
|
||||
### Test Manual Installation Only:
|
||||
|
||||
```bash
|
||||
docker-compose run --rm test-manual
|
||||
```
|
||||
|
||||
### Run All Tests:
|
||||
|
||||
```bash
|
||||
docker-compose up verify-all
|
||||
```
|
||||
|
||||
## 📊 Test Results
|
||||
|
||||
Results are saved to `docker/test-env/test-results/`:
|
||||
|
||||
- `test-YYYYMMDD-HHMMSS.log` - Detailed test logs
|
||||
- `interactive-install-results.txt` - Interactive installer results
|
||||
- `master-prompt-install-results.txt` - Master prompt results
|
||||
- `manual-install-results.txt` - Manual installation results
|
||||
- `test-counts.txt` - Component verification counts
|
||||
- `final-report-YYYYMMDD-HHMMSS.txt` - Comprehensive final report
|
||||
|
||||
## 🎯 Test Verification Matrix
|
||||
|
||||
Each test verifies the following components:
|
||||
|
||||
| Component | Interactive | Master Prompt | Manual |
|
||||
|-----------|-------------|--------------|--------|
|
||||
| Prerequisites | ✅ | ✅ | ✅ |
|
||||
| Claude Code | ✅ | ✅ | ✅ |
|
||||
| Settings Files | ✅ | ✅ | ✅ |
|
||||
| Agents (38) | ✅ | ✅ | ✅ |
|
||||
| MCP Tools | ✅ | ✅ | ✅ |
|
||||
| UI/UX Skill | ✅ | ✅ | ✅ |
|
||||
| Ralph CLI | ⚠️ (skipped) | ⚠️ (skipped) | ⚠️ (skipped) |
|
||||
|
||||
⚠️ = Optional/Skipped to keep tests simple
|
||||
|
||||
## 🐛 Troubleshooting
|
||||
|
||||
### Container fails to build:
|
||||
|
||||
```bash
|
||||
# Check build logs
|
||||
docker-compose build --no-cache
|
||||
|
||||
# Verify Docker is running
|
||||
docker ps
|
||||
```
|
||||
|
||||
### Tests fail with network errors:
|
||||
|
||||
```bash
|
||||
# Check network connectivity
|
||||
docker-compose run test-interactive ping -c 3 github.com
|
||||
|
||||
# Check DNS
|
||||
docker-compose run test-interactive cat /etc/resolv.conf
|
||||
```
|
||||
|
||||
### Permission errors:
|
||||
|
||||
```bash
|
||||
# Fix script permissions
|
||||
chmod +x docker/test-env/test-suite/*.sh
|
||||
|
||||
# Rebuild
|
||||
docker-compose build --no-cache
|
||||
```
|
||||
|
||||
## 🔄 Clean Up
|
||||
|
||||
```bash
|
||||
# Stop all containers
|
||||
docker-compose down
|
||||
|
||||
# Remove test results
|
||||
rm -rf docker/test-env/test-results/
|
||||
|
||||
# Remove built images
|
||||
docker-compose down --rmi all
|
||||
```
|
||||
|
||||
## 📝 Customization
|
||||
|
||||
### Modify test timeout:
|
||||
|
||||
Edit `docker-compose.yml` and add:
|
||||
```yaml
|
||||
environment:
|
||||
- TEST_TIMEOUT=600
|
||||
```
|
||||
|
||||
### Test with Ralph CLI:
|
||||
|
||||
Set environment variable:
|
||||
```bash
|
||||
export TEST_RALPH=true
|
||||
docker-compose run test-interactive
|
||||
```
|
||||
|
||||
### Use different Node.js version:
|
||||
|
||||
Edit `Dockerfile` and change:
|
||||
```dockerfile
|
||||
ENV NODE_VERSION=18 # or 20, or latest
|
||||
```
|
||||
|
||||
## ✅ Success Criteria
|
||||
|
||||
A successful test run should show:
|
||||
|
||||
```
|
||||
✅ All installation methods tested successfully
|
||||
Total Installation Methods Tested: 3
|
||||
Passed: 3
|
||||
Failed: 0
|
||||
|
||||
✅ ALL INSTALLATION METHODS TESTED SUCCESSFULLY
|
||||
Recommendation: All installation methods are PRODUCTION READY
|
||||
```
|
||||
|
||||
## 📞 Support
|
||||
|
||||
If tests fail:
|
||||
1. Check individual test logs in `test-results/`
|
||||
2. Review error messages in the final report
|
||||
3. Verify network connectivity to GitHub
|
||||
4. Ensure Docker has sufficient resources (memory, disk)
|
||||
|
||||
## 🎉 Summary
|
||||
|
||||
This Docker test environment provides comprehensive validation of all three installation methods in isolated, reproducible containers. Each test runs from a clean slate and verifies all components are properly installed and functional.
|
||||
Reference in New Issue
Block a user