Skip to content

Commit 550d043

Browse files
committed
adding the pytest stuff
1 parent 5a13b31 commit 550d043

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ jobs:
158158
echo "Port: $port" | tee -a "$test_output_file"
159159
echo "========================================" | tee -a "$test_output_file"
160160
161+
# Use stdbuf to ensure unbuffered output for real-time visibility
161162
AGENTEX_API_BASE_URL="http://localhost:5003" \
162-
./run_agent_test.sh --build-cli --quiet "$tutorial" 2>&1 | tee -a "$test_output_file"
163+
stdbuf -oL -eL ./run_agent_test.sh --build-cli --quiet "$tutorial" 2>&1 | tee -a "$test_output_file"
163164
164165
exit_code=${PIPESTATUS[0]}
165166
if [ $exit_code -eq 0 ]; then

examples/tutorials/run_agent_test.sh

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,26 @@ check_prerequisites() {
6868
wait_for_agent_ready() {
6969
local name=$1
7070
local logfile="/tmp/agentex-${name}.log"
71-
local timeout=30 # seconds
71+
local timeout=45 # seconds - increased to account for package installation time
7272
local elapsed=0
7373

74-
echo -e "${YELLOW}⏳ Waiting for ${name} agent to be ready...${NC}"
74+
if [ "$QUIET_MODE" = false ]; then
75+
echo -e "${YELLOW}⏳ Waiting for ${name} agent to be ready...${NC}"
76+
fi
7577

7678
while [ $elapsed -lt $timeout ]; do
77-
if grep -q "Application startup complete" "$logfile" 2>/dev/null || \
78-
grep -q "Running workers for task queue" "$logfile" 2>/dev/null; then
79-
echo -e "${GREEN}${name} agent is ready${NC}"
80-
return 0
79+
# Check if agent is successfully registered
80+
if grep -q "Successfully registered agent" "$logfile" 2>/dev/null; then
81+
82+
# For temporal agents, also wait for workers to be ready
83+
if [[ "$tutorial_path" == *"temporal"* ]]; then
84+
# This is a temporal agent - wait for workers too
85+
if grep -q "Running workers for task queue" "$logfile" 2>/dev/null; then
86+
return 0
87+
fi
88+
else
89+
return 0
90+
fi
8191
fi
8292
sleep 1
8393
((elapsed++))
@@ -285,7 +295,8 @@ run_test() {
285295

286296
# Always show pytest output, even in quiet mode
287297
echo "========== PYTEST OUTPUT =========="
288-
uv run pytest tests/test_agent.py -v -s
298+
# Use unbuffered output for real-time visibility
299+
PYTHONUNBUFFERED=1 uv run pytest tests/test_agent.py -v -s --tb=short
289300
exit_code=$?
290301
echo "========== END PYTEST OUTPUT =========="
291302

0 commit comments

Comments
 (0)