Update workflows for agent coordinator and app deps
All checks were successful
API Endpoint Tests / test-api-endpoints (push) Successful in 15s
Deploy to Testnet / deploy-testnet (push) Successful in 1m12s
Integration Tests / test-service-integration (push) Successful in 2m37s
Production Tests / Production Integration Tests (push) Successful in 21s
Python Tests / test-python (push) Successful in 41s
Security Scanning / security-scan (push) Successful in 36s
Deploy to Testnet / notify-deployment (push) Successful in 3s
Node Failover Simulation / failover-test (push) Successful in 2s
Multi-Node Stress Testing / stress-test (push) Successful in 4s
Cross-Node Transaction Testing / transaction-test (push) Successful in 10s

This commit is contained in:
aitbc
2026-05-02 13:34:08 +02:00
parent 940615bb02
commit 316dc8e894
5 changed files with 25 additions and 23 deletions

View File

@@ -4,7 +4,7 @@ on:
push:
branches: [main, develop]
paths:
- 'apps/coordinator-api/**'
- 'apps/agent-coordinator/**'
- 'apps/exchange/**'
- 'apps/wallet/**'
- 'scripts/ci/test_api_endpoints.py'
@@ -93,13 +93,13 @@ jobs:
service_host=""
for candidate in "${host_candidates[@]}"; do
code=$(curl -so /dev/null -w '%{http_code}' "http://$candidate:8000/health" 2>/dev/null) || code=0
code=$(curl -so /dev/null -w '%{http_code}' "http://$candidate:9001/health" 2>/dev/null) || code=0
if [ "$code" -gt 0 ] && [ "$code" -lt 600 ]; then
service_host="$candidate"
break
fi
code=$(curl -so /dev/null -w '%{http_code}' "http://$candidate:8000/v1/health" 2>/dev/null) || code=0
code=$(curl -so /dev/null -w '%{http_code}' "http://$candidate:9001/v1/health" 2>/dev/null) || code=0
if [ "$code" -gt 0 ] && [ "$code" -lt 600 ]; then
service_host="$candidate"
break
@@ -116,7 +116,7 @@ jobs:
echo "Using service host: $service_host"
echo "services_available=true" > /var/lib/aitbc-workspaces/api-tests/status
for port in 8000 8001 8003 8006; do
for port in 9001 8001 8003 8006; do
port_ready=0
for i in $(seq 1 15); do
code=$(curl -so /dev/null -w '%{http_code}' "http://$service_host:$port/health" 2>/dev/null) || code=0

View File

@@ -87,7 +87,7 @@ jobs:
run: |
echo "Waiting for services..."
services_available=true
for port in 8000 8001 8003 8006 9001; do
for port in 9001 8001 8003 8006; do
port_ready=0
for i in $(seq 1 15); do
code=$(curl -so /dev/null -w '%{http_code}' "http://localhost:$port/health" 2>/dev/null) || code=0
@@ -142,7 +142,7 @@ jobs:
run: |
cd /var/lib/aitbc-workspaces/integration-tests/repo
source venv/bin/activate
export PYTHONPATH="apps/coordinator-api/src:apps/wallet/src:apps/exchange/src:$PYTHONPATH"
export PYTHONPATH="apps/agent-coordinator/src:apps/wallet/src:apps/exchange/src:$PYTHONPATH"
# Skip if services not available
if [ "${{ steps.wait-services.outputs.services_available }}" != "true" ]; then

View File

@@ -52,7 +52,7 @@ jobs:
--venv-dir "$PWD/venv" \
--skip-requirements \
--mode copy \
--extra-packages "pytest pytest-cov pytest-mock pytest-timeout pytest-asyncio locust pydantic-settings fastapi uvicorn sqlmodel>=0.0.38"
--extra-packages "pytest pytest-cov pytest-mock pytest-timeout pytest-asyncio locust pydantic-settings fastapi uvicorn aiohttp>=3.12.14 sqlmodel>=0.0.38"
echo "✅ Python environment ready"
- name: Run linting
@@ -73,7 +73,7 @@ jobs:
venv/bin/python -m pip install -e packages/py/aitbc-crypto/
venv/bin/python -m pip install -e packages/py/aitbc-sdk/
export PYTHONPATH="$PWD/apps/coordinator-api/src:$PWD/apps/blockchain-node/src:$PWD/apps/wallet/src:$PWD/packages/py/aitbc-crypto/src:$PWD/packages/py/aitbc-sdk/src:$PWD:$PYTHONPATH"
export PYTHONPATH="$PWD/apps/agent-coordinator/src:$PWD/apps/blockchain-node/src:$PWD/apps/wallet/src:$PWD/packages/py/aitbc-crypto/src:$PWD/packages/py/aitbc-sdk/src:$PWD:$PYTHONPATH"
venv/bin/python -m pytest tests/archived_phase_tests/ \
tests/cross_phase/ \
@@ -85,14 +85,16 @@ jobs:
run: |
cd /var/lib/aitbc-workspaces/python-tests/repo
export PYTHONPATH="$PWD/apps/coordinator-api/src:$PWD/apps/blockchain-node/src:$PWD/apps/wallet/src:$PWD/packages/py/aitbc-crypto/src:$PWD/packages/py/aitbc-sdk/src:$PWD:$PYTHONPATH"
export PYTHONPATH="$PWD/apps/agent-coordinator:$PWD/apps/agent-coordinator/src:$PWD/packages/py/aitbc-crypto/src:$PWD/packages/py/aitbc-sdk/src:$PWD:$PYTHONPATH"
# Test if packages are importable
venv/bin/python -c "import aitbc_crypto; print('✅ aitbc_crypto imported')"
venv/bin/python -c "import aitbc_sdk; print('✅ aitbc_sdk imported')"
venv/bin/python -c "import src.app; print('✅ agent-coordinator src.app imported')"
venv/bin/python -c "import app; print('✅ agent-coordinator app imported')"
venv/bin/python -m pytest \
apps/coordinator-api/tests/ \
apps/agent-coordinator/tests/test_communication.py \
packages/py/aitbc-crypto/tests/ \
packages/py/aitbc-sdk/tests/ \
-c /dev/null --rootdir "$PWD" --import-mode=importlib \

View File

@@ -86,13 +86,13 @@ class TestHierarchicalProtocol:
def test_add_sub_agent(self, master_protocol):
"""Test adding sub-agent"""
master_protocol.add_sub_agent("sub-agent-001")
asyncio.run(master_protocol.add_sub_agent("sub-agent-001"))
assert "sub-agent-001" in master_protocol.sub_agents
def test_send_to_sub_agents(self, master_protocol):
"""Test sending to sub-agents"""
master_protocol.add_sub_agent("sub-agent-001")
master_protocol.add_sub_agent("sub-agent-002")
asyncio.run(master_protocol.add_sub_agent("sub-agent-001"))
asyncio.run(master_protocol.add_sub_agent("sub-agent-002"))
message = MessageTemplates.create_heartbeat("master-agent")
@@ -129,19 +129,19 @@ class TestPeerToPeerProtocol:
def test_add_peer(self, p2p_protocol):
"""Test adding peer"""
p2p_protocol.add_peer("agent-002", {"endpoint": "http://localhost:8002"})
asyncio.run(p2p_protocol.add_peer("agent-002", {"endpoint": "http://localhost:8002"}))
assert "agent-002" in p2p_protocol.peers
assert p2p_protocol.peers["agent-002"]["endpoint"] == "http://localhost:8002"
def test_remove_peer(self, p2p_protocol):
"""Test removing peer"""
p2p_protocol.add_peer("agent-002", {"endpoint": "http://localhost:8002"})
p2p_protocol.remove_peer("agent-002")
asyncio.run(p2p_protocol.add_peer("agent-002", {"endpoint": "http://localhost:8002"}))
asyncio.run(p2p_protocol.remove_peer("agent-002"))
assert "agent-002" not in p2p_protocol.peers
def test_send_to_peer(self, p2p_protocol):
"""Test sending to peer"""
p2p_protocol.add_peer("agent-002", {"endpoint": "http://localhost:8002"})
asyncio.run(p2p_protocol.add_peer("agent-002", {"endpoint": "http://localhost:8002"}))
message = MessageTemplates.create_task_assignment(
"agent-001", "agent-002", {"task": "test"}
@@ -165,16 +165,16 @@ class TestBroadcastProtocol:
def test_subscribe_unsubscribe(self, broadcast_protocol):
"""Test subscribe and unsubscribe"""
broadcast_protocol.subscribe("agent-002")
asyncio.run(broadcast_protocol.subscribe("agent-002"))
assert "agent-002" in broadcast_protocol.subscribers
broadcast_protocol.unsubscribe("agent-002")
asyncio.run(broadcast_protocol.unsubscribe("agent-002"))
assert "agent-002" not in broadcast_protocol.subscribers
def test_broadcast(self, broadcast_protocol):
"""Test broadcasting"""
broadcast_protocol.subscribe("agent-002")
broadcast_protocol.subscribe("agent-003")
asyncio.run(broadcast_protocol.subscribe("agent-002"))
asyncio.run(broadcast_protocol.subscribe("agent-003"))
message = MessageTemplates.create_discovery("agent-001")

View File

@@ -12,7 +12,7 @@ import sys
API_HOST = os.environ.get("AITBC_API_HOST", "localhost")
SERVICES = {
"coordinator": {"url": f"http://{API_HOST}:8000", "endpoints": ["/", "/health", "/info"]},
"agent_coordinator": {"url": f"http://{API_HOST}:9001", "endpoints": ["/", "/health"]},
"exchange": {"url": f"http://{API_HOST}:8001", "endpoints": ["/", "/api/health", "/health", "/info"]},
"wallet": {"url": f"http://{API_HOST}:8003", "endpoints": ["/", "/health", "/wallets"]},
"blockchain_rpc": {"url": f"http://{API_HOST}:8006", "endpoints": ["/health", "/rpc/head", "/rpc/head?chain_id=ait-mainnet", "/rpc/head?chain_id=ait-testnet", "/rpc/mempool"]},
@@ -79,7 +79,7 @@ def main():
print("\n⚡ Performance tests...")
perf = test_performance([
("Coordinator", f"http://{API_HOST}:8000/health"),
("Agent Coordinator", f"http://{API_HOST}:9001/health"),
("Exchange", f"http://{API_HOST}:8001/api/health"),
("Wallet", f"http://{API_HOST}:8003/health"),
("Blockchain RPC", f"http://{API_HOST}:8006/health"),