Files
ruflo/tests/docker
rUvandClaude b32adc7e71 docs: Add comprehensive v2.7.1 verification and alpha tag documentation
Added complete documentation for v2.7.1 release verification:

Documentation Added:
- PATTERN_FIX_CONFIRMATION.md - Comprehensive fix verification for all 3 MCP pattern issues
- DOCKER_VERIFICATION_REPORT.md - Docker test results (94.4% pass rate, 0 regressions)
- RELEASE_SUMMARY_v2.7.1.md - Complete release summary and metrics
- ALPHA_TAG_UPDATE.md - npm alpha tag update documentation

Test Suite Added:
- tests/docker/Dockerfile - Clean environment testing
- tests/docker/docker-compose.yml - Docker orchestration
- tests/docker/regression-tests.sh - 12 regression tests
- tests/docker/verify-patterns.sh - 6 pattern-specific tests
- tests/verification/test-pattern-fixes.js - Live MCP verification test

Verification Results:
✅ Pattern Store: Data now persists to 'patterns' namespace
✅ Pattern Search: neural_patterns handler fully implemented
✅ Pattern Stats: Statistics tracked in 'pattern-stats' namespace
✅ Docker Tests: 17/18 passed (94.4%), 0 regressions
✅ Alpha Tag: Updated to point to v2.7.1

Fixes confirmed for GitHub issue #827

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 20:15:56 +00:00
..

Docker Validation Suite for Claude-Flow

This directory contains Docker-based testing infrastructure to validate claude-flow functionality in a clean, isolated environment that simulates a remote deployment.

🎯 Purpose

  • Clean Environment Testing: Validates installation in a fresh environment without local dependencies
  • Production Simulation: Tests the actual user experience of installing and using claude-flow
  • CI/CD Integration: Can be used in automated testing pipelines
  • Cross-Platform Validation: Tests on Linux (Alpine) to ensure portability

📁 Files

  • Dockerfile.test - Main test container with Node 18 and required dependencies
  • docker-compose.test.yml - Multi-container setup for integration testing
  • run-validation.sh - Comprehensive validation script (50+ tests)
  • README.md - This file

🚀 Quick Start

# From project root
cd tests/docker

# Build the test container
docker build -f Dockerfile.test -t claude-flow-test ../..

# Run validation suite
docker run --rm claude-flow-test sh -c "cd /home/testuser && tests/docker/run-validation.sh"

Option 2: Interactive Testing

# Start container with docker-compose
docker-compose -f docker-compose.test.yml up -d

# Enter the container
docker exec -it claude-flow-test sh

# Inside container, run tests
cd /home/testuser
./tests/docker/run-validation.sh

# Or test individual commands
./bin/claude-flow --help
./bin/claude-flow memory store test "value"
./bin/claude-flow agent agents

Option 3: Full Integration Test Suite

# Start all services (including SQLite)
docker-compose -f docker-compose.test.yml up -d

# Run integration tests
docker-compose -f docker-compose.test.yml exec claude-flow-integration \
  sh -c "cd /home/testuser && ./tests/docker/run-validation.sh"

# Clean up
docker-compose -f docker-compose.test.yml down -v

🧪 Test Coverage

The validation suite tests:

Phase 1: Installation & Build

  • ✅ NPM and Node.js versions
  • ✅ Build completion
  • ✅ Binary generation

Phase 2: CLI Basic Commands

  • ✅ Help command
  • ✅ Version command
  • ✅ Agent help

Phase 3: Memory Commands (Basic Mode)

  • ✅ Memory store
  • ✅ Memory query
  • ✅ Memory stats
  • ✅ Memory list
  • ✅ Memory export/import

Phase 4: ReasoningBank Commands

  • ✅ Mode detection
  • ✅ Mode configuration
  • ✅ Status display

Phase 5: Agent Commands

  • ✅ Agent listing
  • ✅ Agent info
  • ✅ Agent configuration

Phase 6: Proxy Commands

  • ✅ Proxy help
  • ✅ Proxy configuration
  • ✅ OpenRouter integration

Phase 7: Help System

  • ✅ Main help with all features
  • ✅ Agent help with memory
  • ✅ Feature discoverability

Phase 8: Security Features

  • ✅ API key redaction
  • ✅ Secure storage
  • ✅ Redacted queries

Phase 9: File Structure

  • ✅ Memory directory creation
  • ✅ Memory store file
  • ✅ Proper permissions

Phase 10: Integration Tests

  • ✅ Import/export workflows
  • ✅ Namespace operations
  • ✅ Error handling

📊 Expected Output

🐳 Claude-Flow Docker Validation Suite
========================================

📦 Phase 1: Installation & Build
--------------------------------
Testing: NPM install... ✓ PASS
Testing: Node version... ✓ PASS
Testing: Build completed... ✓ PASS
Testing: Binary exists... ✓ PASS

🔧 Phase 2: CLI Basic Commands
------------------------------
Testing: Help command... ✓ PASS
...

========================================
📊 Test Results Summary
========================================
Total Tests: 50
Passed: 50
Failed: 0

✅ All tests passed!
🚀 Claude-Flow is ready for production release

🔧 Troubleshooting

Issue: Build fails in Docker

# Clean build
docker build --no-cache -f Dockerfile.test -t claude-flow-test ../..

Issue: Permission errors

# The Dockerfile uses a non-root user (testuser)
# This is intentional to simulate real user environment
# If you need root, modify the Dockerfile

Issue: Tests timeout

# Increase timeout in validation script
# Or run specific test phases individually
docker exec -it claude-flow-test ./bin/claude-flow --help

🎯 CI/CD Integration

GitHub Actions Example

name: Docker Validation

on: [push, pull_request]

jobs:
  docker-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Build test container
        run: |
          cd tests/docker
          docker build -f Dockerfile.test -t claude-flow-test ../..

      - name: Run validation suite
        run: |
          docker run --rm claude-flow-test \
            sh -c "cd /home/testuser && tests/docker/run-validation.sh"

📝 Adding New Tests

To add new validation tests, edit run-validation.sh:

test_command "Your test description" \
    "./bin/claude-flow your-command" \
    "expected-output-pattern"

🌐 Multi-Platform Testing

# Build for multiple platforms
docker buildx build --platform linux/amd64,linux/arm64 \
    -f Dockerfile.test -t claude-flow-test ../..

🔒 Security Testing

The validation suite includes security tests:

  • API key redaction
  • Secure storage validation
  • Permission checks

🤝 Contributing

When adding new features to claude-flow:

  1. Add corresponding tests to run-validation.sh
  2. Update the test coverage section in this README
  3. Run full validation suite before submitting PR

📞 Support

For issues with Docker validation:

  • Check Docker logs: docker logs claude-flow-test
  • Review test output for specific failures
  • Open issue on GitHub with validation output