-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
126 lines (106 loc) · 4.12 KB
/
Copy pathMakefile
File metadata and controls
126 lines (106 loc) · 4.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
.PHONY: help test test-fast test-all test-unit test-integration test-workflow test-archivist test-verbose validate install clean start start-logs stop logs logs-color
# Default target
help:
@echo "Elastic News - Makefile Commands"
@echo "================================="
@echo ""
@echo "Testing:"
@echo " make test - Run fast tests (excludes slow tests)"
@echo " make test-fast - Same as 'make test'"
@echo " make test-all - Run all tests including slow ones"
@echo " make test-unit - Run only unit tests"
@echo " make test-integration - Run integration tests"
@echo " make test-workflow - Run full workflow test"
@echo " make test-archivist - Run Archivist A2A integration tests"
@echo " make test-verbose - Run tests with verbose output"
@echo " make test-coverage - Run tests with coverage report"
@echo " make validate - Validate all API keys and endpoints"
@echo ""
@echo "Development:"
@echo " make install - Install dependencies"
@echo " make start - Start all agents"
@echo " make start-logs - Start agents + UI + show colorized logs"
@echo " make start-ui - Start agents + React UI"
@echo " make stop - Stop all agents"
@echo " make clean - Clean up generated files"
@echo ""
@echo "Agent Management:"
@echo " make logs - View all agent logs (plain)"
@echo " make logs-color - View colorized agent logs (recommended)"
@echo " make status - Check agent health"
# Testing targets
test:
@echo "🧪 Running fast tests (excluding slow tests)..."
pytest -v -m "not slow"
test-fast: test
test-all:
@echo "🧪 Running all tests (including slow tests)..."
pytest -v
test-unit:
@echo "🧪 Running unit tests..."
pytest -v -m unit
test-integration:
@echo "🧪 Running integration tests..."
pytest -v -m integration
test-workflow:
@echo "🧪 Running workflow tests..."
pytest -v -m workflow tests/test_workflow_pytest.py
test-archivist:
@echo "🧪 Running Archivist A2A integration tests..."
pytest -v tests/test_archivist_a2a.py
test-verbose:
@echo "🧪 Running tests with verbose output..."
pytest -vv -s
test-coverage:
@echo "🧪 Running tests with coverage..."
pytest --cov=agents --cov=utils --cov-report=html --cov-report=term
validate:
@echo "🔑 Validating API keys and endpoints..."
pytest -v -s tests/test_validate_config.py
# Development targets
install:
@echo "📦 Installing dependencies..."
pip install -r requirements.txt
@echo "✅ Dependencies installed"
start:
@echo "🚀 Starting all agents..."
./scripts/start_newsroom.sh --reload
start-logs:
@echo "🚀 Starting all agents + UI with colorized logs..."
@./scripts/start_newsroom.sh --with-ui --reload
@sleep 3
@echo ""
@python scripts/view_logs.py
start-ui:
@echo "🚀 Starting agents + React UI..."
./scripts/start_newsroom.sh --with-ui --reload
stop:
@echo "🛑 Stopping all agents..."
./scripts/start_newsroom.sh --stop
clean:
@echo "🧹 Cleaning up..."
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
rm -rf htmlcov/ .coverage 2>/dev/null || true
@echo "✅ Cleanup complete"
# Agent management
logs:
@echo "📋 Viewing agent logs (Ctrl+C to stop)..."
tail -f logs/*.log
logs-color:
@python scripts/view_logs.py
status:
@echo "🔍 Checking agent health..."
@python -c "import asyncio; from tests.conftest import AGENT_URLS; import httpx; from a2a.client import A2ACardResolver; \
async def check(): \
async with httpx.AsyncClient(timeout=5.0) as client: \
for name, url in AGENT_URLS.items(): \
try: \
card_resolver = A2ACardResolver(client, url); \
await card_resolver.get_agent_card(); \
print(f' ✅ {name:15s} {url}'); \
except Exception as e: \
print(f' ❌ {name:15s} {url} - {str(e)[:50]}'); \
asyncio.run(check())"