Skip to content

Commit 5b8f23b

Browse files
committed
checking tutorial ports
1 parent ea16c53 commit 5b8f23b

File tree

2 files changed

+72
-4
lines changed

2 files changed

+72
-4
lines changed

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

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
cd scale-agentex/agentex
3030
echo "🚀 Starting dependencies (Postgres, Redis, Temporal, MongoDB)..."
3131
32-
# Start all services except the agentex service
32+
# Start all services
3333
docker compose up -d
3434
3535
echo "⏳ Waiting for dependencies to be healthy..."
@@ -44,8 +44,26 @@ jobs:
4444
sleep 5
4545
done
4646
47-
# Verify all deps are up
47+
# Wait specifically for AgentEx server to be ready
48+
echo "⏳ Waiting for AgentEx server to be ready..."
49+
for i in {1..30}; do
50+
if curl -s --max-time 5 http://localhost:5003/health >/dev/null 2>&1; then
51+
echo "✅ AgentEx server is ready"
52+
break
53+
fi
54+
echo " Attempt $i/30: Waiting for AgentEx server..."
55+
sleep 5
56+
done
57+
58+
# Debug port mappings
59+
echo "🔍 Docker port mappings:"
4860
docker compose ps
61+
echo ""
62+
echo "🔍 Docker port details:"
63+
docker compose ps --format "table {{.Name}}\t{{.Image}}\t{{.Ports}}"
64+
echo ""
65+
echo "🔍 Testing AgentEx server accessibility:"
66+
curl -v --max-time 10 http://localhost:5003/health 2>&1 || echo "❌ AgentEx not accessible on localhost:5003"
4967
5068
- name: Build AgentEx SDK
5169
run: |
@@ -124,9 +142,13 @@ jobs:
124142
echo "Updated $manifest_path to use port $port"
125143
fi
126144
145+
# Debug connectivity before running test
146+
echo "🔍 Pre-test connectivity check:"
147+
curl -v --max-time 5 http://localhost:5003/agents 2>&1 || echo "❌ /agents endpoint not accessible"
148+
127149
# Run test in background with unique port
128150
(
129-
AGENTEX_API_BASE_URL="http://host.docker.internal:5003" \
151+
AGENTEX_API_BASE_URL="http://localhost:5003" \
130152
./run_agent_test.sh --build-cli "$tutorial"
131153
132154
if [ $? -eq 0 ]; then

examples/tutorials/run_agent_test.sh

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,52 @@ run_test() {
260260
# Change to tutorial directory
261261
cd "$tutorial_path" || return 1
262262

263+
# Debug connectivity inside uv environment
264+
echo -e "${YELLOW}🔍 Testing connectivity inside uv environment...${NC}"
265+
uv run python -c "
266+
import os
267+
print(f'AGENTEX_API_BASE_URL: {os.environ.get(\"AGENTEX_API_BASE_URL\", \"NOT SET\")}')
268+
try:
269+
import httpx
270+
response = httpx.get('http://localhost:5003/agents', timeout=10)
271+
print(f'✅ HTTP request successful: {response.status_code}')
272+
print(f'Response: {response.text}')
273+
except Exception as e:
274+
print(f'❌ HTTP request failed: {e}')
275+
276+
print('\\n🔍 Testing AgentEx SDK send_message...')
277+
try:
278+
from agentex import Agentex
279+
from agentex.types.agent_rpc_params import ParamsSendMessageRequest
280+
from agentex.types import TextContentParam
281+
282+
client = Agentex(base_url='http://localhost:5003')
283+
print(f'✅ AgentEx client created successfully')
284+
285+
# Make the same request as the failing test
286+
response = client.agents.send_message(
287+
agent_name='$name',
288+
params=ParamsSendMessageRequest(
289+
content=TextContentParam(
290+
author='user',
291+
content='Hello, Agent! How are you?',
292+
type='text',
293+
)
294+
),
295+
)
296+
print(f'✅ SDK send_message successful')
297+
print(f'Response result: {response.result}')
298+
if response.result:
299+
print(f'Result length: {len(response.result)}')
300+
if len(response.result) > 0:
301+
print(f'First message content: {response.result[0].content}')
302+
303+
except Exception as e:
304+
print(f'❌ AgentEx SDK send_message failed: {e}')
305+
import traceback
306+
traceback.print_exc()
307+
"
308+
263309
# Run the tests
264310
uv run pytest tests/test_agent.py -v -s
265311
local exit_code=$?
@@ -428,4 +474,4 @@ main() {
428474
}
429475

430476
# Run main function
431-
main
477+
main

0 commit comments

Comments
 (0)