Skip to content

Commit 7e9b901

Browse files
committed
add failed logs
1 parent 30875ea commit 7e9b901

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/agentex-tutorials-test.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,47 @@ jobs:
121121
wait "$pid"
122122
done
123123
124+
# Always show AgentEx server container logs immediately after tests complete
125+
echo ""
126+
echo "========================================="
127+
echo "AGENTEX SERVER CONTAINER LOGS"
128+
echo "========================================="
129+
130+
# Show AgentEx server container logs
131+
echo "📋 AgentEx server container logs:"
132+
echo "----------------------------------------"
133+
cd ../scale-agentex/agentex || {
134+
echo "❌ Failed to navigate to scale-agentex/agentex directory"
135+
echo "Current directory: $(pwd)"
136+
echo "Directory contents:"
137+
ls -la ../
138+
}
139+
140+
echo "Current directory: $(pwd)"
141+
echo "Available containers:"
142+
docker compose ps || docker ps
143+
144+
echo ""
145+
echo "AgentEx container logs (last 100 lines):"
146+
docker compose logs agentex --tail=100 || {
147+
echo "❌ Failed to get agentex container logs, trying alternative methods..."
148+
docker logs $(docker ps --filter "name=agentex" --format "{{.ID}}") --tail=100 2>/dev/null || {
149+
echo "❌ No agentex container found, showing all container logs:"
150+
docker compose logs --tail=50 || {
151+
echo "❌ Docker compose logs failed, trying docker logs for all containers:"
152+
docker ps --format "table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}"
153+
for container in $(docker ps --format "{{.ID}}"); do
154+
echo "--- Container $container logs ---"
155+
docker logs "$container" --tail=20
156+
done
157+
}
158+
}
159+
}
160+
echo "----------------------------------------"
161+
162+
# Return to tutorial directory
163+
cd ../../examples/tutorials
164+
124165
# Restore all original manifests
125166
echo ""
126167
echo "Restoring original manifest files..."
@@ -140,6 +181,7 @@ jobs:
140181
fi
141182
done
142183
184+
143185
# Print summary
144186
echo ""
145187
echo "========================================="
@@ -155,6 +197,33 @@ jobs:
155197
for test in "${failed_tests[@]}"; do
156198
echo " ❌ $test"
157199
done
200+
201+
echo ""
202+
echo "========================================="
203+
echo "TUTORIAL AGENT LOGS FOR FAILED TESTS"
204+
echo "========================================="
205+
206+
# Show logs for failed tests
207+
for test in "${failed_tests[@]}"; do
208+
test_name=$(basename "$test")
209+
logfile="/tmp/agentex-${test_name}.log"
210+
211+
echo ""
212+
echo "📋 Tutorial agent logs for $test ($logfile):"
213+
echo "----------------------------------------"
214+
215+
if [ -f "$logfile" ]; then
216+
echo "Last 100 lines of tutorial agent logs:"
217+
tail -100 "$logfile"
218+
else
219+
echo "⚠️ No log file found at: $logfile"
220+
echo "Available log files:"
221+
ls -la /tmp/agentex-*.log 2>/dev/null || echo " (none)"
222+
fi
223+
224+
echo "----------------------------------------"
225+
done
226+
158227
exit 1
159228
else
160229
echo ""

0 commit comments

Comments
 (0)