docker-testing.ymlโข31.5 kB
---
name: Docker Testing
# Uses native ARM64 runners (ubuntu-24.04-arm) for ARM64 builds to eliminate QEMU emulation overhead
# AMD64 builds use ubuntu-latest, ARM64 builds use native ARM64 hardware
# This eliminates the 10-22x performance penalty of QEMU emulation for TypeScript compilation
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
permissions:
contents: read
env:
NODE_OPTIONS: --max-old-space-size=4096
CI: true
TEST_PERSONAS_DIR: ${{ github.workspace }}/test-personas
# Enhanced debugging environment variables
BUILDX_NO_DEFAULT_ATTESTATIONS: 1
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
jobs:
docker-build-test:
name: Docker Build & Test (${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
- platform: linux/arm64
runner: ubuntu-24.04-arm
steps:
- name: ๐ Session Start - Log System Information
shell: bash
run: |
echo "======================================"
echo "๐ CI ENVIRONMENT DIAGNOSTIC SESSION"
echo "======================================"
echo "โฐ Session Start: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "๐ Platform Target: ${{ matrix.platform }}"
echo "๐ฅ๏ธ Runner OS: ${{ runner.os }}"
echo "๐๏ธ Runner Architecture: ${{ runner.arch }}"
echo "๐ฏ Runner Type: ${{ matrix.runner }}"
echo "๐ฆ Workflow: ${{ github.workflow }}"
echo "๐ Run ID: ${{ github.run_id }}"
if [ "${{ matrix.platform }}" = "linux/arm64" ]; then
echo "๐ ARM64: Using NATIVE runner (no QEMU emulation)"
else
echo "๐ AMD64: Using standard runner"
fi
echo "======================================"
echo "\n๐ฅ๏ธ SYSTEM RESOURCES:"
echo "CPU Info:"
nproc || echo "nproc not available"
cat /proc/cpuinfo | grep -E 'processor|model name|cpu cores' | head -10 || echo "CPU info not available"
echo "\nMemory Info:"
free -h || echo "free command not available"
echo "\nDisk Space:"
df -h / || echo "df command not available"
echo "\nLoad Average:"
uptime || echo "uptime not available"
echo "\n๐ณ DOCKER ENVIRONMENT:"
echo "Docker Version:"
docker --version || echo "Docker not found"
echo "Docker Info:"
docker info | head -20 || echo "Docker info failed"
echo "Docker System Status:"
docker system df || echo "Docker system df failed"
echo "\n๐ NETWORK & CONNECTIVITY:"
echo "Checking network connectivity..."
ping -c 2 8.8.8.8 || echo "Network connectivity test failed"
echo "======================================"
echo "โฐ System Info Complete: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "======================================"
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: ๐ง Set up QEMU (AMD64 only - ARM64 uses native runner)
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64
if: matrix.platform == 'linux/amd64'
- name: ๐ง Set up Docker Buildx (with diagnostics)
shell: bash
run: |
echo "======================================"
echo "โฐ Buildx Setup Start: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "๐ Target Platform: ${{ matrix.platform }}"
echo "======================================"
echo "\n๐ Pre-Buildx Docker State:"
docker version || echo "Docker version failed"
docker buildx version || echo "Buildx not available"
docker buildx ls || echo "No buildx instances"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ matrix.platform }}
- name: ๐ Buildx Post-Setup Diagnostics
shell: bash
run: |
echo "\n๐ Post-Buildx Docker State:"
echo "Buildx instances:"
docker buildx ls
echo "\nCurrent builder info:"
docker buildx inspect
echo "\nSupported platforms:"
docker buildx inspect | grep -A 10 "Platforms:" || echo "Platform info not available"
echo "\n๐งช Platform Test:"
echo "Testing basic platform compatibility..."
docker buildx build --platform ${{ matrix.platform }} - <<< 'FROM alpine:latest' || echo "Platform test failed"
echo "======================================"
echo "โฐ Buildx Setup Complete: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "======================================"
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: docker-buildx-${{ runner.os }}-${{ matrix.platform }}-${{ github.sha }}
restore-keys: |
docker-buildx-${{ runner.os }}-${{ matrix.platform }}-
docker-buildx-${{ runner.os }}-
- name: ๐จ Build Docker image (builder stage) - VERBOSE
shell: bash
run: |
echo "======================================"
echo "โฐ Builder Stage Start: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "๐ Platform: ${{ matrix.platform }}"
echo "======================================"
# Convert platform to tag-safe format (replace / with -)
PLATFORM_TAG=$(echo "${{ matrix.platform }}" | sed 's/\//-/g')
echo "๐ท๏ธ Platform Tag: ${PLATFORM_TAG}"
echo "\n๐ Pre-Build Environment:"
echo "Working Directory: $(pwd)"
echo "Available Memory: $(free -h | grep Mem || echo 'Memory info unavailable')"
echo "Docker Status: $(docker system df || echo 'Docker df failed')"
echo "Build Context Size:"
du -sh . || echo "Size calculation failed"
echo "\n๐๏ธ Starting Docker Build with VERBOSE output..."
echo "Command: docker buildx build --platform ${{ matrix.platform }} --target builder --progress=plain"
# Store start time
BUILD_START=$(date +%s)
echo "โฐ Build Start Time: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
# Run build with verbose output and error handling
set +e # Don't exit on error, we want to capture it
docker buildx build \
--platform ${{ matrix.platform }} \
--target builder \
--tag dollhousemcp:builder-${PLATFORM_TAG} \
--cache-from type=local,src=/tmp/.buildx-cache \
--cache-to type=local,dest=/tmp/.buildx-cache-new,mode=max \
--progress=plain \
--load \
--file docker/Dockerfile \
. 2>&1 | tee /tmp/build-output.log
BUILD_EXIT_CODE=$?
BUILD_END=$(date +%s)
BUILD_DURATION=$((BUILD_END - BUILD_START))
echo "\n======================================"
echo "โฐ Build End Time: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "โฑ๏ธ Build Duration: ${BUILD_DURATION} seconds"
echo "๐ Exit Code: ${BUILD_EXIT_CODE}"
echo "======================================"
echo "\n๐ Post-Build Analysis:"
echo "Final 50 lines of build output:"
tail -50 /tmp/build-output.log || echo "Could not read build log"
echo "\nDocker Images After Build:"
docker images | grep dollhousemcp || echo "No dollhousemcp images found"
echo "\nSystem Resources After Build:"
free -h | grep Mem || echo "Memory info unavailable"
docker system df || echo "Docker df failed"
# Exit with the actual build exit code
if [ $BUILD_EXIT_CODE -ne 0 ]; then
echo "โ BUILDER STAGE FAILED!"
echo "Full build log contents:"
cat /tmp/build-output.log || echo "Could not read full build log"
exit $BUILD_EXIT_CODE
else
echo "โ
Builder stage completed successfully"
fi
set -e # Re-enable exit on error
- name: ๐๏ธ Build Docker image (production stage) - VERBOSE
shell: bash
run: |
echo "======================================"
echo "โฐ Production Stage Start: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "๐ Platform: ${{ matrix.platform }}"
echo "======================================"
# Convert platform to tag-safe format (replace / with -)
PLATFORM_TAG=$(echo "${{ matrix.platform }}" | sed 's/\//-/g')
echo "๐ท๏ธ Platform Tag: ${PLATFORM_TAG}"
echo "\n๐ Pre-Production Build State:"
echo "Available Images:"
docker images | grep dollhousemcp || echo "No dollhousemcp images found"
echo "Available Memory: $(free -h | grep Mem || echo 'Memory info unavailable')"
echo "Docker Status: $(docker system df || echo 'Docker df failed')"
# Store start time
PROD_START=$(date +%s)
echo "โฐ Production Build Start: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
# Run production build with verbose output
set +e # Don't exit on error, we want to capture it
docker buildx build \
--platform ${{ matrix.platform }} \
--target production \
--tag dollhousemcp:latest-${PLATFORM_TAG} \
--cache-from type=local,src=/tmp/.buildx-cache \
--cache-to type=local,dest=/tmp/.buildx-cache-new,mode=max \
--progress=plain \
--load \
--file docker/Dockerfile \
. 2>&1 | tee /tmp/prod-build-output.log
PROD_EXIT_CODE=$?
PROD_END=$(date +%s)
PROD_DURATION=$((PROD_END - PROD_START))
echo "\n======================================"
echo "โฐ Production Build End: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "โฑ๏ธ Production Duration: ${PROD_DURATION} seconds"
echo "๐ Exit Code: ${PROD_EXIT_CODE}"
echo "======================================"
echo "\n๐ Post-Production Analysis:"
echo "Final production images:"
docker images | grep dollhousemcp || echo "No dollhousemcp images found"
echo "\nImage layers and size:"
docker history dollhousemcp:latest-${PLATFORM_TAG} || echo "Could not inspect image history"
# Exit with the actual build exit code
if [ $PROD_EXIT_CODE -ne 0 ]; then
echo "โ PRODUCTION STAGE FAILED!"
echo "Full production build log:"
cat /tmp/prod-build-output.log || echo "Could not read production build log"
exit $PROD_EXIT_CODE
else
echo "โ
Production stage completed successfully"
fi
set -e # Re-enable exit on error
- name: Scan Docker image for vulnerabilities
uses: anchore/scan-action@v3
with:
image: dollhousemcp:latest-linux-amd64
fail-build: false # Don't fail build on vulnerabilities, just report
severity-cutoff: high
continue-on-error: true
if: matrix.platform == 'linux/amd64' # Only scan AMD64 to save time on ARM64 builds
- name: ๐ Test MCP server initialization - ULTRA VERBOSE
shell: bash
run: |
echo "========================================="
echo "โฐ MCP Test Start: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "๐ Platform: ${{ matrix.platform }}"
echo "๐ฏ Test: MCP Server Initialization"
echo "========================================="
# Convert platform to tag-safe format (replace / with -)
PLATFORM_TAG=$(echo "${{ matrix.platform }}" | sed 's/\//-/g')
echo "๐ท๏ธ Platform Tag: ${PLATFORM_TAG}"
echo "\n๐ Pre-Test Environment Check:"
echo "Available Images:"
docker images | grep dollhousemcp || echo "No dollhousemcp images found - THIS IS A PROBLEM!"
echo "\nSystem Resources:"
free -h | grep Mem || echo "Memory info unavailable"
echo "Available CPU: $(nproc || echo 'nproc unavailable')"
echo "Load Average: $(uptime || echo 'uptime unavailable')"
echo "\n๐งช Container Preparation Test:"
echo "Testing basic container creation for platform ${{ matrix.platform }}..."
docker run --rm --platform ${{ matrix.platform }} dollhousemcp:latest-${PLATFORM_TAG} echo "Container creation test passed" || {
echo "โ CRITICAL: Cannot create basic container for platform ${{ matrix.platform }}!"
echo "This indicates a fundamental platform compatibility issue."
exit 1
}
echo "\n๐ Constructing MCP Test Command:"
MCP_JSON_REQUEST='{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"1.0.0","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}},"id":1}'
echo "JSON Request: $MCP_JSON_REQUEST"
DOCKER_CMD="docker run -i \
--platform ${{ matrix.platform }} \
--user 1001:1001 \
--security-opt no-new-privileges \
--read-only \
--tmpfs /tmp:noexec,nosuid,mode=1777 \
--tmpfs /app/tmp:noexec,nosuid,mode=1777 \
--memory 512m \
--cpus 0.5 \
--env DOLLHOUSE_PORTFOLIO_DIR=/app/tmp/portfolio \
--env DOLLHOUSE_CACHE_DIR=/app/tmp/cache \
dollhousemcp:latest-${PLATFORM_TAG}"
echo "\nDocker Command: $DOCKER_CMD"
echo "\nโฐ Starting MCP Test with Platform-Specific Timeout:"
if [ "${{ matrix.platform }}" = "linux/arm64" ]; then
TIMEOUT_DURATION=10
echo "๐ ARM64 Platform: Using native ARM64 runner, timeout of ${TIMEOUT_DURATION}s"
else
TIMEOUT_DURATION=5
echo "๐ AMD64 Platform: Using standard timeout of ${TIMEOUT_DURATION}s"
fi
# Store test start time
TEST_START=$(date +%s)
echo "โฐ Test Start Time: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
# Run the test with comprehensive error capture
set +e # Don't exit on error, we want to analyze it
echo "\n๐ Executing MCP Server Test..."
docker_output=$(timeout $TIMEOUT_DURATION sh -c "echo '$MCP_JSON_REQUEST' | $DOCKER_CMD 2>&1" || true)
test_exit_code=$?
TEST_END=$(date +%s)
TEST_DURATION=$((TEST_END - TEST_START))
echo "\n========================================="
echo "โฐ Test End Time: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "โฑ๏ธ Test Duration: ${TEST_DURATION} seconds (timeout was ${TIMEOUT_DURATION}s)"
echo "๐ Exit Code: ${test_exit_code}"
echo "========================================="
echo "\n๐ DETAILED OUTPUT ANALYSIS:"
echo "Raw output length: ${#docker_output} characters"
if [ -z "$docker_output" ]; then
echo "โ CRITICAL: No output captured at all!"
echo "This suggests the container failed to start or produce any output."
else
echo "โ
Output captured, analyzing content..."
echo "\n๐ FULL RAW OUTPUT (first 5000 chars):"
echo "--- BEGIN OUTPUT ---"
echo "$docker_output" | head -c 5000
echo ""
echo "--- END OUTPUT ---"
# Extract and display JSON-RPC response if present
echo "\n๐ SEARCHING FOR JSON-RPC RESPONSE:"
json_response=$(echo "$docker_output" | grep -o '{"jsonrpc":"2.0"[^}]*}' || echo "")
if [ -n "$json_response" ]; then
echo "โ
FOUND JSON-RPC RESPONSE:"
echo "$json_response" | jq '.' 2>/dev/null || echo "$json_response"
# Extract specific fields for validation
echo "\n๐ RESPONSE DETAILS:"
echo "- Protocol: $(echo "$json_response" | grep -o '"jsonrpc":"[^"]*"' || echo 'Not found')"
echo "- ID: $(echo "$json_response" | grep -o '"id":[^,}]*' || echo 'Not found')"
echo "- Server Name: $(echo "$json_response" | grep -o '"name":"[^"]*"' || echo 'Not found')"
echo "- Has Result: $(echo "$json_response" | grep -q '"result"' && echo 'Yes' || echo 'No')"
echo "- Has Error: $(echo "$json_response" | grep -q '"error"' && echo 'Yes' || echo 'No')"
else
echo "โ ๏ธ No JSON-RPC response pattern found in output"
echo "Looking for any JSON-like content..."
echo "$docker_output" | grep -o '{.*}' | head -5 || echo "No JSON patterns found"
fi
fi
echo "\n๐ PLATFORM-SPECIFIC ANALYSIS:"
if [ "${{ matrix.platform }}" = "linux/arm64" ]; then
echo "๐ ARM64 Analysis:"
echo "- Running on native ARM64 runner (ubuntu-24.04-arm)"
echo "- No QEMU emulation overhead"
echo "- Expected native performance"
echo "- Timeout duration: ${TIMEOUT_DURATION}s"
echo "- Actual duration: ${TEST_DURATION}s"
if [ $TEST_DURATION -ge $TIMEOUT_DURATION ]; then
echo "โ ๏ธ Test hit timeout limit - investigate performance issue!"
else
echo "โ
Test completed within timeout window"
fi
else
echo "๐ AMD64 Analysis:"
echo "- Running natively on x86_64"
echo "- Expected fast performance"
echo "- Duration: ${TEST_DURATION}s"
fi
echo "\n๐งช JSON-RPC RESPONSE VALIDATION:"
if echo "$docker_output" | grep -q '"jsonrpc":"2.0".*"id":1'; then
echo "โ
Valid JSON-RPC response structure found"
if echo "$docker_output" | grep -q '"serverInfo":{"name":"dollhousemcp"'; then
echo "โ
Correct serverInfo found - MCP server is working properly"
echo "\n๐ TEST PASSED FOR ${{ matrix.platform }}!"
else
echo "โ ๏ธ JSON-RPC response found but missing expected serverInfo"
echo "Response may be incomplete or malformed"
fi
else
echo "โ FAILED: No valid JSON-RPC response found"
echo "\n๐ FAILURE ANALYSIS:"
# Check for common failure patterns
if echo "$docker_output" | grep -qi "error\|failed\|exception"; then
echo "๐ฅ Error messages found in output:"
echo "$docker_output" | grep -i "error\|failed\|exception" || echo "Could not extract error messages"
fi
if echo "$docker_output" | grep -qi "timeout\|killed"; then
echo "โฐ Timeout-related messages:"
echo "$docker_output" | grep -i "timeout\|killed" || echo "Could not extract timeout messages"
fi
if [ $test_exit_code -eq 124 ]; then
echo "โฐ TIMEOUT CONFIRMED: Test was killed by timeout command"
echo "This means the server took longer than ${TIMEOUT_DURATION}s to respond"
if [ "${{ matrix.platform }}" = "linux/arm64" ]; then
echo "๐ก NOTE: Running on native ARM64 - timeout should not be due to emulation"
fi
elif [ $test_exit_code -ne 0 ]; then
echo "๐ฅ NON-ZERO EXIT: Docker command failed with code $test_exit_code"
fi
echo "\nโ MCP SERVER TEST FAILED FOR ${{ matrix.platform }}"
set -e
exit 1
fi
set -e # Re-enable exit on error
echo "\n========================================="
echo "โ
MCP INITIALIZATION TEST COMPLETED SUCCESSFULLY"
echo "Platform: ${{ matrix.platform }}"
echo "Duration: ${TEST_DURATION}s"
echo "========================================="
- name: ๐ Test MCP server with tools/list command - VERBOSE
shell: bash
run: |
echo "========================================="
echo "โฐ Tools/List Test Start: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "๐ Platform: ${{ matrix.platform }}"
echo "๐ฏ Test: MCP Server Tools/List Functionality"
echo "========================================="
# Convert platform to tag-safe format (replace / with -)
PLATFORM_TAG=$(echo "${{ matrix.platform }}" | sed 's/\//-/g')
echo "๐ท๏ธ Platform Tag: ${PLATFORM_TAG}"
echo "\n๐ Constructing Tools/List Test Command:"
TOOLS_JSON_REQUEST='{"jsonrpc":"2.0","method":"tools/list","params":{},"id":2}'
echo "JSON Request: $TOOLS_JSON_REQUEST"
echo "\nโฐ Starting Tools/List Test with Platform-Specific Timeout:"
if [ "${{ matrix.platform }}" = "linux/arm64" ]; then
TIMEOUT_DURATION=10
echo "๐ ARM64 Platform: Using native ARM64 runner, timeout of ${TIMEOUT_DURATION}s"
else
TIMEOUT_DURATION=5
echo "๐ AMD64 Platform: Using standard timeout of ${TIMEOUT_DURATION}s"
fi
# Store test start time
TOOLS_START=$(date +%s)
echo "โฐ Tools Test Start Time: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
# Run the tools/list test
set +e # Don't exit on error, we want to analyze it
echo "\n๐ Executing Tools/List Test..."
docker_output=$(timeout $TIMEOUT_DURATION sh -c "echo '$TOOLS_JSON_REQUEST' | \
docker run -i \
--platform ${{ matrix.platform }} \
--user 1001:1001 \
--security-opt no-new-privileges \
--read-only \
--tmpfs /tmp:noexec,nosuid,mode=1777 \
--tmpfs /app/tmp:noexec,nosuid,mode=1777 \
--memory 512m \
--cpus 0.5 \
--env DOLLHOUSE_PORTFOLIO_DIR=/app/tmp/portfolio \
--env DOLLHOUSE_CACHE_DIR=/app/tmp/cache \
dollhousemcp:latest-${PLATFORM_TAG} 2>&1" || true)
tools_exit_code=$?
TOOLS_END=$(date +%s)
TOOLS_DURATION=$((TOOLS_END - TOOLS_START))
echo "\n========================================="
echo "โฐ Tools Test End Time: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "โฑ๏ธ Tools Test Duration: ${TOOLS_DURATION} seconds"
echo "๐ Exit Code: ${tools_exit_code}"
echo "========================================="
echo "\n๐ TOOLS/LIST RAW OUTPUT (first 5000 chars):"
echo "--- BEGIN OUTPUT ---"
echo "$docker_output" | head -c 5000
echo ""
echo "--- END OUTPUT ---"
# Extract and display tools/list response
echo "\n๐ EXTRACTING TOOLS/LIST JSON-RPC RESPONSE:"
tools_response=$(echo "$docker_output" | grep -o '{"jsonrpc":"2.0".*}' || echo "")
if [ -n "$tools_response" ]; then
echo "โ
FOUND TOOLS/LIST JSON-RPC RESPONSE:"
# Try to pretty print with jq, fall back to raw if jq fails
echo "$tools_response" | jq '.' 2>/dev/null || echo "$tools_response"
# Extract details about the tools
echo "\n๐ TOOLS/LIST RESPONSE ANALYSIS:"
echo "- Protocol Version: $(echo "$tools_response" | grep -o '"jsonrpc":"[^"]*"' || echo 'Not found')"
echo "- Request ID: $(echo "$tools_response" | grep -o '"id":[^,}]*' || echo 'Not found')"
# Check if we have tools in the response
if echo "$tools_response" | grep -q '"tools":\['; then
echo "- Tools Array: โ
Present"
# Try to count and list tools
tool_names=$(echo "$tools_response" | grep -o '"name":"[^"]*"' | sed 's/"name":"//g' | sed 's/"//g')
tool_count=$(echo "$tool_names" | wc -l | tr -d ' ')
echo "- Tool Count: $tool_count tools returned"
if [ -n "$tool_names" ]; then
echo "\n๐ฆ TOOLS FOUND:"
echo "$tool_names" | head -10 | while read -r tool; do
echo " - $tool"
done
if [ "$tool_count" -gt 10 ]; then
echo " ... and $((tool_count - 10)) more"
fi
fi
else
echo "- Tools Array: โ Not found or empty"
fi
else
echo "โ ๏ธ No valid JSON-RPC response found in tools/list output"
echo "Checking for any JSON-like patterns..."
echo "$docker_output" | grep -o '{.*}' | head -3 || echo "No JSON patterns detected"
fi
echo "\n๐งช JSON-RPC RESPONSE VALIDATION:"
if echo "$docker_output" | grep -q '"jsonrpc":"2.0".*"id":2'; then
echo "โ
Valid JSON-RPC response structure found for tools/list"
if echo "$docker_output" | grep -q '"result"'; then
echo "โ
Response contains result field - server is fully functional"
echo "\n๐ TOOLS/LIST TEST PASSED FOR ${{ matrix.platform }}!"
else
echo "โ ๏ธ JSON-RPC response found but missing result field"
echo "Response may be incomplete"
fi
else
echo "โ FAILED: No valid JSON-RPC response found for tools/list"
echo "\n๐ TOOLS/LIST FAILURE ANALYSIS:"
if [ $tools_exit_code -eq 124 ]; then
echo "โฐ TIMEOUT: Tools/list test was killed by timeout"
echo "Duration: ${TOOLS_DURATION}s (limit: ${TIMEOUT_DURATION}s)"
else
echo "๐ฅ Command failed with exit code: $tools_exit_code"
fi
echo "\nโ TOOLS/LIST TEST FAILED FOR ${{ matrix.platform }}"
set -e
exit 1
fi
set -e # Re-enable exit on error
echo "\n========================================="
echo "โ
TOOLS/LIST TEST COMPLETED SUCCESSFULLY"
echo "Platform: ${{ matrix.platform }}"
echo "Duration: ${TOOLS_DURATION}s"
echo "========================================="
- name: Cleanup containers
if: always()
shell: bash
run: |
echo "๐งน Cleaning up any dangling containers..."
docker system prune -f --volumes || true
- name: Move cache
if: always()
shell: bash
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache || true
- name: Docker testing complete
shell: bash
run: |
echo "โ
Docker Testing Complete for ${{ matrix.platform }}!"
echo "Platform: ${{ matrix.platform }}"
echo "All tests passed successfully"
docker-compose-test:
name: Docker Compose Test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Test MINIMAL Docker Compose (hello world test)
shell: bash
run: |
echo "๐งช Testing MINIMAL Docker Compose to verify Docker works at all..."
echo "This should just echo 'Hello' and exit successfully"
docker compose --file docker/docker-compose.minimal.yml build minimal-test
docker compose --file docker/docker-compose.minimal.yml run --rm minimal-test
echo "โ
Minimal Docker test passed!"
- name: Test Docker Compose build
shell: bash
run: |
echo "๐ณ Testing Docker Compose build..."
echo "๐ Verifying directory structure before Docker build:"
echo "Current directory: $(pwd)"
echo "Checking if src/ exists:"
ls -la src/ | head -5 || echo "src/ directory not found!"
echo "Checking docker/ directory:"
ls -la docker/ || echo "docker/ directory not found!"
echo "Using docker-compose.yml with proper tmpfs permissions"
# Build using the regular Dockerfile which compiles TypeScript inside Docker
docker compose --file docker/docker-compose.yml build dollhousemcp
- name: Test Docker Compose startup
shell: bash
run: |
echo "๐ Testing Docker Compose startup..."
# Run MCP server with initialize command via Docker Compose
echo "โณ Running MCP server via Docker Compose with initialize command..."
# Portfolio directory is already set to /app/tmp/portfolio in docker-compose.yml
# Use timeout since MCP server runs indefinitely
docker_output=$(timeout 5 sh -c 'echo '"'"'{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"1.0.0","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}},"id":1}'"'"' | docker compose --file docker/docker-compose.yml run --rm -T dollhousemcp 2>&1' || true)
exit_code=$?
echo "Docker Compose run completed with exit code: $exit_code"
echo "Output captured:"
echo "$docker_output"
# Check for successful MCP response from Docker Compose
if echo "$docker_output" | grep -q '"jsonrpc":"2.0".*"id":1'; then
echo "โ
Docker Compose MCP server returned valid JSON-RPC response"
if echo "$docker_output" | grep -q '"serverInfo":{"name":"dollhousemcp"'; then
echo "โ
Response contains correct serverInfo - server is working"
fi
else
echo "โ FAILED: Docker Compose MCP server did not return a JSON-RPC response"
echo "The server is not responding to API calls through Docker Compose"
exit 1
fi
- name: Cleanup Docker Compose
if: always()
run: |
echo "๐งน Cleaning up Docker Compose..."
docker compose --file docker/docker-compose.yml down
docker compose --file docker/docker-compose.yml rm -f
- name: Docker Compose testing complete
shell: bash
run: |
echo "โ
Docker Compose Testing Complete!"
echo "All tests passed successfully"