6161 echo "UV version: $(uv --version)"
6262 echo "UV path: $(which uv)"
6363
64+ # Start background job to continuously poll AgentEx container logs
65+ echo "🔍 Starting AgentEx container log polling in background..."
66+ (
67+ echo "Log polling started at $(date)"
68+
69+ # Function to get container logs
70+ get_logs() {
71+ echo "=== AgentEx Container Logs $(date) ==="
72+ docker logs agentex --tail=20 2>/dev/null || {
73+ echo "⚠️ Failed to get logs from 'agentex' container"
74+ echo "Available containers:"
75+ docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Image}}"
76+ }
77+ echo "=== End Logs ==="
78+ echo ""
79+ }
80+
81+ # Poll logs every 2 seconds (very frequent for debugging)
82+ while true; do
83+ get_logs
84+ sleep 2
85+ done
86+ ) &
87+
88+ LOG_POLLER_PID=$!
89+ echo "📋 Log poller started with PID: $LOG_POLLER_PID"
90+
6491 # Find all tutorial directories
6592 tutorial_paths=()
6693 for dir in $(find . -name "manifest.yaml" -exec dirname {} \; | sort); do
99126
100127 # Run test in background with unique port
101128 (
102- AGENTEX_API_BASE_URL="http://localhost :5003" \
129+ AGENTEX_API_BASE_URL="http://host.docker.internal :5003" \
103130 ./run_agent_test.sh --build-cli "$tutorial"
104131
105132 if [ $? -eq 0 ]; then
@@ -121,6 +148,32 @@ jobs:
121148 wait "$pid"
122149 done
123150
151+ # Always show AgentEx server container logs immediately after tests complete
152+ echo ""
153+ echo "========================================="
154+ echo "AGENTEX SERVER CONTAINER LOGS"
155+ echo "========================================="
156+
157+ # Show AgentEx server container logs
158+ echo "📋 AgentEx server container logs:"
159+ echo "----------------------------------------"
160+
161+ echo "Available containers:"
162+ docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Image}}"
163+
164+ echo ""
165+ echo "AgentEx container logs (last 100 lines):"
166+ docker logs agentex --tail=100 2>/dev/null || {
167+ echo "❌ Failed to get logs from 'agentex' container"
168+ echo "Available containers:"
169+ docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Image}}"
170+ }
171+ echo "----------------------------------------"
172+
173+ # Stop the log poller
174+ echo "🛑 Stopping log poller (PID: $LOG_POLLER_PID)"
175+ kill $LOG_POLLER_PID 2>/dev/null || echo "Log poller already stopped"
176+
124177 # Restore all original manifests
125178 echo ""
126179 echo "Restoring original manifest files..."
@@ -140,6 +193,7 @@ jobs:
140193 fi
141194 done
142195
196+
143197 # Print summary
144198 echo ""
145199 echo "========================================="
@@ -155,6 +209,33 @@ jobs:
155209 for test in "${failed_tests[@]}"; do
156210 echo " ❌ $test"
157211 done
212+
213+ echo ""
214+ echo "========================================="
215+ echo "TUTORIAL AGENT LOGS FOR FAILED TESTS"
216+ echo "========================================="
217+
218+ # Show logs for failed tests
219+ for test in "${failed_tests[@]}"; do
220+ test_name=$(basename "$test")
221+ logfile="/tmp/agentex-${test_name}.log"
222+
223+ echo ""
224+ echo "📋 Tutorial agent logs for $test ($logfile):"
225+ echo "----------------------------------------"
226+
227+ if [ -f "$logfile" ]; then
228+ echo "Last 100 lines of tutorial agent logs:"
229+ tail -100 "$logfile"
230+ else
231+ echo "⚠️ No log file found at: $logfile"
232+ echo "Available log files:"
233+ ls -la /tmp/agentex-*.log 2>/dev/null || echo " (none)"
234+ fi
235+
236+ echo "----------------------------------------"
237+ done
238+
158239 exit 1
159240 else
160241 echo ""
0 commit comments