This document describes how to test the oc-hatchery functionality.
Tests hatch.sh functionality without requiring Docker networking:
./scripts/test-hatch.shThis test validates:
- ✓ Instance creation with hatch.sh
- ✓ Directory structure
- ✓ Required files (Dockerfile, docker-compose.yml, .env.example)
- ✓ Workspace files (AGENTS.md, SOUL.md, etc.)
- ✓ Port configuration
- ✓ Container naming
Time: ~1 second
Requirements: bash
Validates the Dockerfile configuration and best practices:
./scripts/validate-dockerfile.shThis validation checks:
- ✓ Alpine package dependencies (git, curl, bash, gettext)
- ✓ Non-root user configuration
- ✓ UID/GID configuration (1001)
- ✓ Entrypoint script setup
- ✓ Health check configuration
- ✓ Port exposure
- ✓ Workspace directory structure
- ✓ Environment variable templating
- ✓ API key validation
- ✓ Production environment settings
- ✓ Docker image build (if package available)
Time: 1-3 minutes
Requirements: Docker (for full validation)
See DOCKERFILE_VALIDATION.md for detailed validation results.
Tests the complete workflow from hatch to launch:
./scripts/e2e-test.shThis test validates:
- ✓ Instance creation with hatch.sh
- ✓ Directory and file structure
- ✓ Docker image build
- ✓ Container startup
- ✓ Health check endpoint
- ✓ TUI accessibility
- ✓ fleet.sh status reporting
- ✓ Clean shutdown with docker compose down
Time: 3-5 minutes (first run), faster on subsequent runs
Requirements:
- Docker + Docker Compose
- Network access for Docker image builds
- At least one LLM API key (optional but recommended)
The e2e test will use API keys from environment variables if available:
# Using Anthropic
export ANTHROPIC_API_KEY="your-key-here"
./scripts/e2e-test.sh
# Or using OpenAI
export OPENAI_API_KEY="your-key-here"
./scripts/e2e-test.shWithout API keys, the container will start but may not be fully functional.
./scripts/hatch.sh my-advisor --port 18790cd instances/my-advisor
cp .env.example .env
# Edit .env and add your API keysEdit the files in workspace/:
SOUL.md- Define personality and expertiseIDENTITY.md- Set name, role, emojiUSER.md- Describe who this instance helps- Add reference docs to
workspace/reference/
docker compose up -d --buildCheck health:
curl http://localhost:18790/healthAccess TUI:
open http://localhost:18790
# or
curl http://localhost:18790Check status:
# From the repository root
./scripts/fleet.sh statusView logs:
docker compose logs -f
# or
./scripts/fleet.sh logs my-advisordocker compose down
# or from repository root
./scripts/fleet.sh stopIf you see errors like "TLS: unspecified error" when building:
- Check your network connection
- Try setting Docker DNS servers:
# In /etc/docker/daemon.json { "dns": ["8.8.8.8", "8.8.4.4"] }
- Restart Docker daemon
- Check logs:
docker compose logs - Verify port is not already in use:
lsof -i :18790 - Check if API keys are set in .env
- Verify OpenClaw installed correctly:
docker exec -it hatchery-my-advisor openclaw --version - Try accessing directly:
docker exec -it hatchery-my-advisor sh
If the container builds but OpenClaw doesn't work:
- Check if openclaw is installed:
docker exec hatchery-my-advisor which openclaw - Try running openclaw directly:
docker exec hatchery-my-advisor openclaw --help - Check npm global packages:
docker exec hatchery-my-advisor npm list -g
See KNOWN_ISSUES.md for more details.
Change the port when creating the instance:
./scripts/hatch.sh my-advisor --port 18791- Ensure Docker Desktop is running
- File sharing should be enabled for the repository directory
- Default resources (2GB RAM) should be sufficient
- Ensure your user is in the
dockergroup:sudo usermod -aG docker $USER - Log out and back in for group changes to take effect
- Ensure Docker daemon is running:
sudo systemctl status docker
- Run tests from within WSL2
- Ensure WSL2 integration is enabled in Docker Desktop settings
- Repository should be on WSL2 filesystem for best performance
The e2e test is designed to gracefully handle network restrictions common in CI environments. It will:
- Run all non-Docker tests
- Attempt Docker build
- If Docker build fails due to network issues, exit gracefully with passed core tests
- If Docker build succeeds, run full end-to-end validation
This allows the test to provide useful feedback even in restricted environments.