Complete end-to-end testing environment for MUXI Runtime, containing all test files, Docker configurations, and utilities needed for comprehensive system validation.
e2e/ ├── tests/ # All E2E test files (215+ tests) │ ├── 1_foundation/ # Basic formation and chat tests │ ├── 2_memory/ # Memory system tests │ ├── 3_multimodal/ # Image, audio, video processing │ ├── 4_mcp/ # Model Context Protocol tests │ ├── 5_artifacts/ # File generation tests │ ├── 6_knowledge/ # Knowledge base tests │ ├── 7_orchestration/# Multi-agent coordination │ ├── 8_clarification/# Clarification flow tests │ ├── 9_async/ # Async operation tests │ ├── 10_streaming/ # Response streaming tests │ ├── 11_formatting/ # Output formatting tests │ ├── 12_scheduling/ # Task scheduling tests │ └── common/ # Shared test utilities ├── docker/ # Docker configurations │ ├── Dockerfile # All-in-one testing environment │ ├── docker-compose.yml # Service orchestration │ └── README.md # Docker-specific documentation ├── scripts/ # Test runner scripts │ ├── docker-build.sh # Build Docker image │ └── run-docker-tests.sh # Run tests in Docker ├── utils/ # Utility services │ ├── webhook_server.py # Async webhook handler (port 8765) │ └── a2a_registry.py # A2A registry mock (port 9090) ├── fixtures/ # Test data and formations │ ├── formations/ # Test formation configs │ └── test-data/ # Sample test data ├── results/ # Test output directory ├── logs/ # Service and test logs ├── docs/ # E2E-specific documentation ├── .env.example # Environment variables template └── README.md # This file cd e2e cp .env.example .env # Edit .env and add your API keys (especially OPENAI_API_KEY)# Build the Docker image docker build -f e2e/docker/Dockerfile -t muxi-e2e . # Start all services docker-compose -f e2e/docker/docker-compose.yml up -d # Verify services are healthy docker ps # Should show: muxi-e2e-test container running (healthy)# Run tests inside container docker exec -it muxi-e2e-test pytest e2e/tests/1_foundation/ -v # Or run specific test docker exec -it muxi-e2e-test python e2e/tests/1_foundation/test_1a6_simple_formation.py # Interactive shell for debugging docker exec -it muxi-e2e-test bashOnce the container is running, these services are available:
- PostgreSQL 17 + pgvector:
localhost:5432 - FAISSx (no auth):
localhost:45678(ZeroMQ protocol) - FAISSx (with auth):
localhost:65432(ZeroMQ protocol) - Webhook Server:
http://localhost:8765/health - A2A Registry:
http://localhost:9090/health
| Area | Tests | Purpose | Key Features |
|---|---|---|---|
| 1_foundation | 10 | Core functionality | Formation loading, basic chat |
| 2_memory | 26 | Memory systems | Buffer, persistent, vector search |
| 3_multimodal | 38 | Media processing | Images, audio, video, documents |
| 4_mcp | 24 | Tool integration | MCP servers, tool discovery |
| 5_artifacts | 15 | File generation | Charts, reports, code generation |
| 6_knowledge | 19 | Knowledge base | Search, retrieval, updates |
| 7_orchestration | 25 | Multi-agent | Coordination, delegation, workflows |
| 8_clarification | 49 | User interaction | Clarification flows, context |
| 9_async | 12 | Async operations | Async requests, callbacks |
| 10_streaming | 6 | Response streaming | Real-time streaming |
| 11_formatting | 4 | Output formatting | Markdown, JSON, custom formats |
| 12_scheduling | 11 | Task scheduling | Cron, delayed execution |
- PostgreSQL: Database for persistent storage
- FAISSx (x2): Vector databases (with/without auth)
- OpenAI API: Required for LLM operations
- Webhook Server: Async response handling
- A2A Registry: Agent-to-agent communication
# Using pytest pytest e2e/tests/2_memory/ -v # Using test runner ./e2e/scripts/test-in-docker.sh --area 2# Direct execution python e2e/tests/1_foundation/test_1a6_simple_formation.py # With pytest pytest e2e/tests/1_foundation/test_1a6_simple_formation.py -v -s# Verbose output pytest e2e/tests/ -v -s # Stop on first failure pytest e2e/tests/ -x # Run parallel pytest e2e/tests/ -n 4 # With coverage pytest e2e/tests/ --cov=muxi --cov-report=htmlcd e2e/docker docker-compose -f docker-compose.all-in-one.yml build# All services docker-compose -f docker-compose.e2e.yml up -d # Minimal services docker-compose -f docker-compose.test-minimal.yml up -d# All service logs docker-compose -f docker-compose.e2e.yml logs -f # Specific service docker logs muxi-e2e-test -f# Stop services docker-compose -f docker-compose.e2e.yml down # Remove volumes docker-compose -f docker-compose.e2e.yml down -v # Full cleanup ./e2e/scripts/test-in-docker.sh --cleanOPENAI_API_KEY: OpenAI API key for LLM operationsPOSTGRES_URI: PostgreSQL connection stringFAISSX_NO_AUTH_URL: FAISSx without auth (default: http://localhost:45678)FAISSX_WITH_AUTH_URL: FAISSx with auth (default: http://localhost:65432)
ANTHROPIC_API_KEY: For Anthropic modelsGEMINI_API_KEY: For Google modelsA2A_REGISTRY_URL: A2A Registry URLWEBHOOK_URL: Webhook server URLTEST_PARALLEL_WORKERS: Number of parallel test workersTEST_TIMEOUT_MULTIPLIER: Timeout adjustment factor
jobs: e2e-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Build E2E image run: | cd e2e/docker docker-compose -f docker-compose.all-in-one.yml build - name: Run E2E tests env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} run: | cd e2e/docker docker-compose -f docker-compose.all-in-one.yml run --rm \ muxi-e2e-all pytest e2e/tests/ -v --junit-xml=results/junit.xml - name: Upload results uses: actions/upload-artifact@v2 with: name: test-results path: e2e/results/# Ensure PYTHONPATH is set correctly export PYTHONPATH=$PYTHONPATH:$(pwd)/src:$(pwd)/e2e # Or run from runtime directory cd runtime python -m pytest e2e/tests/# Check if services are running docker ps # Test PostgreSQL connection psql postgresql://muxi:test123@localhost:5432/muxi_test -c "SELECT 1" # Test FAISSx curl http://localhost:45678/health# Check environment echo $OPENAI_API_KEY # Verify in container docker exec muxi-e2e-test env | grep API_KEY- Use the all-in-one Docker setup for consistent environment
- Run specific areas during development, full suite before commits
- Check logs in
e2e/logs/for debugging - Use
--shellmode for interactive debugging - Keep services running between test runs with
--no-cleanup
Tests follow three main patterns:
- Pattern 1: Runtime modification - modifies formation at runtime
- Pattern 2: Shared directory - uses shared formation directory
- Pattern 3: Separate formations - each test has its own formation
- Add new tests to appropriate area directory
- Follow existing test structure and naming
- Use base classes for consistency
- Document test purpose and validation
- Run linting before committing:
ruff check e2e/tests/