Fix Docker tests to achieve 100% on 2/3 installation methods
Major fixes: - Fixed Claude Code verification (was checking 'claude-code', now checks 'claude') - Fixed volume mount paths (use absolute path /tmp/claude-repo for runtime) - Fixed agents copy path (removed incorrect /agents/ subdirectory) - Fixed critical agent paths (studio-coach in bonus/, not project-management) - Added expect package for interactive installer automation - Fixed test count aggregation to read from individual result files Test Results (after fixes): ✅ Manual Installation: 27/27 passing (100%) ✅ Master Prompt Installation: 15/15 passing (100%) ⚠️ Interactive Installer: 7/13 passing (54% - expect automation issue) Note: Interactive installer works fine for manual testing, just difficult to automate with expect scripts due to prompt matching complexity.
This commit is contained in:
@@ -21,6 +21,7 @@ RUN apt-get update && apt-get install -y \
|
|||||||
bash \
|
bash \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
gnupg \
|
gnupg \
|
||||||
|
expect \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install Node.js 20.x from official NodeSource repository
|
# Install Node.js 20.x from official NodeSource repository
|
||||||
@@ -39,8 +40,8 @@ RUN useradd -m -s /bin/bash testuser && \
|
|||||||
WORKDIR /home/testuser
|
WORKDIR /home/testuser
|
||||||
RUN chown -R testuser:testuser /home/testuser
|
RUN chown -R testuser:testuser /home/testuser
|
||||||
|
|
||||||
# Copy repository files
|
# Copy repository files (relative to build context)
|
||||||
COPY --chown=testuser:testuser ../../ /home/testuser/claude-code-glm-suite/
|
COPY --chown=testuser:testuser ../../../ /home/testuser/claude-code-glm-suite/
|
||||||
|
|
||||||
# Switch to test user
|
# Switch to test user
|
||||||
USER testuser
|
USER testuser
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: claude-interactive-test
|
container_name: claude-interactive-test
|
||||||
volumes:
|
volumes:
|
||||||
- ../../:/home/testman/claude-code-glm-suite
|
- /tmp/claude-repo:/home/testuser/claude-code-glm-suite
|
||||||
environment:
|
environment:
|
||||||
- TEST_MODE=interactive
|
- TEST_MODE=interactive
|
||||||
- ANTHROPIC_AUTH_TOKEN=${ANTHROPIC_AUTH_TOKEN:-test-token}
|
- ANTHROPIC_AUTH_TOKEN=${ANTHROPIC_AUTH_TOKEN:-test-token}
|
||||||
@@ -23,7 +23,7 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: claude-master-prompt-test
|
container_name: claude-master-prompt-test
|
||||||
volumes:
|
volumes:
|
||||||
- ../../:/home/testuser/claude-code-glm-suite
|
- /tmp/claude-repo:/home/testuser/claude-code-glm-suite
|
||||||
environment:
|
environment:
|
||||||
- TEST_MODE=master-prompt
|
- TEST_MODE=master-prompt
|
||||||
- ANTHROPIC_AUTH_TOKEN=${ANTHROPIC_AUTH_TOKEN:-test-token}
|
- ANTHROPIC_AUTH_TOKEN=${ANTHROPIC_AUTH_TOKEN:-test-token}
|
||||||
@@ -38,7 +38,7 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: claude-manual-test
|
container_name: claude-manual-test
|
||||||
volumes:
|
volumes:
|
||||||
- ../../:/home/testuser/claude-code-glm-suite
|
- /tmp/claude-repo:/home/testuser/claude-code-glm-suite
|
||||||
environment:
|
environment:
|
||||||
- TEST_MODE=manual
|
- TEST_MODE=manual
|
||||||
- ANTHROPIC_AUTH_TOKEN=${ANTHROPIC_AUTH_TOKEN:-test-token}
|
- ANTHROPIC_AUTH_TOKEN=${ANTHROPIC_AUTH_TOKEN:-test-token}
|
||||||
@@ -53,7 +53,7 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: claude-verify-all
|
container_name: claude-verify-all
|
||||||
volumes:
|
volumes:
|
||||||
- ../../:/home/testuser/claude-code-glm-suite
|
- /tmp/claude-repo:/home/testuser/claude-code-glm-suite
|
||||||
environment:
|
environment:
|
||||||
- TEST_MODE=verify
|
- TEST_MODE=verify
|
||||||
command: /home/testuser/test-suite/verify-all-installations.sh
|
command: /home/testuser/test-suite/verify-all-installations.sh
|
||||||
|
|||||||
@@ -115,20 +115,14 @@ check_dir() {
|
|||||||
verify_claude_code() {
|
verify_claude_code() {
|
||||||
log_section "Verifying Claude Code Installation"
|
log_section "Verifying Claude Code Installation"
|
||||||
|
|
||||||
if check_command claude-code; then
|
if check_command claude; then
|
||||||
test_pass "Claude Code is installed"
|
test_pass "Claude Code is installed"
|
||||||
VERSION=$(claude-code --version 2>/dev/null || echo "unknown")
|
VERSION=$(claude --version 2>/dev/null || echo "unknown")
|
||||||
log_info "Version: $VERSION"
|
log_info "Version: $VERSION"
|
||||||
else
|
else
|
||||||
test_fail "Claude Code not found"
|
test_fail "Claude Code not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if check_command claude; then
|
|
||||||
test_pass "Claude command is available"
|
|
||||||
else
|
|
||||||
test_fail "Claude command not found"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,8 @@ run_test() {
|
|||||||
|
|
||||||
log_section "Running: $test_name"
|
log_section "Running: $test_name"
|
||||||
|
|
||||||
# Reset counters
|
# Clear previous results file for this test
|
||||||
TESTS_PASSED=0
|
rm -f "$RESULTS_DIR/${test_name}-results.txt"
|
||||||
TESTS_FAILED=0
|
|
||||||
TESTS_WARNINGS=0
|
|
||||||
|
|
||||||
# Run the test
|
# Run the test
|
||||||
if bash "$test_script"; then
|
if bash "$test_script"; then
|
||||||
@@ -47,9 +45,6 @@ run_test() {
|
|||||||
|
|
||||||
TOTAL_TESTS=$((TOTAL_TESTS + 1))
|
TOTAL_TESTS=$((TOTAL_TESTS + 1))
|
||||||
|
|
||||||
# Save test counts
|
|
||||||
echo "$test_name:$TESTS_PASSED:$TESTS_FAILED:$TESTS_WARNINGS" >> "$RESULTS_DIR/test-counts.txt"
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,16 +112,21 @@ COMPONENT VERIFICATION:
|
|||||||
|
|
||||||
REPORT_EOF2
|
REPORT_EOF2
|
||||||
|
|
||||||
# Read individual test counts
|
# Read individual test result files
|
||||||
if [ -f "$RESULTS_DIR/test-counts.txt" ]; then
|
for results_file in "$RESULTS_DIR"/*-results.txt; do
|
||||||
while IFS=: read -r test_name passed failed warnings; do
|
if [ -f "$results_file" ]; then
|
||||||
|
local test_name=$(grep "^Test:" "$results_file" | sed 's/Test: //')
|
||||||
|
local passed=$(grep "^Passed:" "$results_file" | sed 's/Passed: //')
|
||||||
|
local failed=$(grep "^Failed:" "$results_file" | sed 's/Failed: //')
|
||||||
|
local warnings=$(grep "^Warnings:" "$results_file" | sed 's/Warnings: //')
|
||||||
|
|
||||||
echo "" >> "$FINAL_REPORT"
|
echo "" >> "$FINAL_REPORT"
|
||||||
echo "$test_name:" >> "$FINAL_REPORT"
|
echo "$test_name:" >> "$FINAL_REPORT"
|
||||||
echo " Passed: $passed" >> "$FINAL_REPORT"
|
echo " Passed: $passed" >> "$FINAL_REPORT"
|
||||||
echo " Failed: $failed" >> "$FINAL_REPORT"
|
echo " Failed: $failed" >> "$FINAL_REPORT"
|
||||||
echo " Warnings: $warnings" >> "$FINAL_REPORT"
|
echo " Warnings: $warnings" >> "$FINAL_REPORT"
|
||||||
done < "$RESULTS_DIR/test-counts.txt"
|
fi
|
||||||
fi
|
done
|
||||||
|
|
||||||
cat >> "$FINAL_REPORT" << REPORT_EOF3
|
cat >> "$FINAL_REPORT" << REPORT_EOF3
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user