-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
224 lines (187 loc) Β· 6.74 KB
/
Makefile
File metadata and controls
224 lines (187 loc) Β· 6.74 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# Automotas AI Testing Framework Makefile
# =======================================
.PHONY: help install setup test test-unit test-integration test-e2e test-performance test-security clean docker-up docker-down reports
# Default target
help:
@echo "π§ͺ Automotas AI Testing Framework"
@echo "================================="
@echo ""
@echo "Available targets:"
@echo " install Install dependencies"
@echo " setup Set up test environment"
@echo " test Run all tests"
@echo " test-unit Run unit tests only"
@echo " test-integration Run integration tests only"
@echo " test-e2e Run end-to-end tests"
@echo " test-performance Run performance tests"
@echo " test-security Run security tests"
@echo " docker-up Start test infrastructure"
@echo " docker-down Stop test infrastructure"
@echo " reports Generate test reports"
@echo " clean Clean up test artifacts"
@echo ""
# Installation and setup
install:
@echo "π¦ Installing dependencies..."
pip install -r requirements.txt
setup: install
@echo "π§ Setting up test environment..."
@if [ ! -f .env ]; then cp .env.example .env; echo "π Created .env file from template"; fi
mkdir -p reports test_data logs
@echo "β
Test environment ready"
# Test execution targets
test: setup
@echo "π§ͺ Running all tests..."
python run_tests.py --reports --parallel
test-unit: setup
@echo "π¬ Running unit tests..."
python run_tests.py --level unit --reports
test-integration: setup
@echo "π Running integration tests..."
python run_tests.py --level integration --reports
test-e2e: setup
@echo "π― Running end-to-end tests..."
python run_tests.py --level e2e --reports
test-performance: setup
@echo "β‘ Running performance tests..."
python run_tests.py --filter performance --reports
test-security: setup
@echo "π Running security tests..."
python run_tests.py --filter security --level security --reports
# Specific test suites
test-agents: setup
@echo "π€ Testing agent management..."
python run_tests.py --filter agents --reports
test-workflows: setup
@echo "π Testing workflow orchestration..."
python run_tests.py --filter workflows --reports
test-context: setup
@echo "π§ Testing context engineering..."
python run_tests.py --filter context_engineering --reports
test-multi-agent: setup
@echo "π₯ Testing multi-agent systems..."
python run_tests.py --filter multi_agent --reports
test-memory: setup
@echo "π§© Testing memory systems..."
python run_tests.py --filter memory_systems --reports
# Docker infrastructure
docker-up:
@echo "π³ Starting test infrastructure..."
docker-compose up -d
@echo "β³ Waiting for services to be ready..."
sleep 10
@echo "β
Test infrastructure ready"
docker-down:
@echo "π Stopping test infrastructure..."
docker-compose down
docker-clean: docker-down
@echo "π§Ή Cleaning up Docker resources..."
docker-compose down -v
docker system prune -f
# Environment-specific testing
test-dev: setup
@echo "π§ Running tests against development environment..."
python run_tests.py --environment development --reports
test-staging: setup
@echo "π Running tests against staging environment..."
python run_tests.py --environment staging --reports
test-prod: setup
@echo "π Running tests against production environment..."
python run_tests.py --environment production --reports --filter "not destructive"
# Reporting and analysis
reports:
@echo "π Generating test reports..."
@if [ -d reports ]; then \
echo "Latest test reports:"; \
ls -la reports/ | head -10; \
echo ""; \
echo "π Open reports/test_report_*.html in your browser"; \
else \
echo "No reports found. Run tests first with --reports flag"; \
fi
view-reports:
@echo "π Starting report server..."
@if command -v python3 >/dev/null 2>&1; then \
cd reports && python3 -m http.server 8080 & \
echo "π Reports available at http://localhost:8080"; \
echo "Press Ctrl+C to stop the server"; \
else \
echo "Python not found. Please open reports/test_report_*.html manually"; \
fi
# Continuous integration targets
ci-test: docker-up
@echo "π Running CI tests..."
python run_tests.py --reports --parallel --environment development
$(MAKE) docker-down
ci-security-scan:
@echo "π‘οΈ Running security scans for CI..."
python run_tests.py --filter security --level security --reports --environment staging
# Development helpers
format:
@echo "π
Formatting code..."
black framework/ tests/ --line-length 100
isort framework/ tests/ --profile black
lint:
@echo "π Linting code..."
flake8 framework/ tests/ --max-line-length 100 --ignore E203,W503
mypy framework/ tests/ --ignore-missing-imports
validate: format lint
@echo "β
Code validation complete"
# Monitoring and maintenance
health-check:
@echo "π₯ Checking system health..."
@if curl -s http://localhost:8000/health >/dev/null 2>&1; then \
echo "β
Automotas AI backend is healthy"; \
else \
echo "β Automotas AI backend is not responding"; \
fi
@if curl -s http://localhost:5678 >/dev/null 2>&1; then \
echo "β
N8N is running"; \
else \
echo "β οΈ N8N is not running (optional)"; \
fi
logs:
@echo "π Recent test logs..."
@if [ -d logs ]; then \
tail -50 logs/test_runner.log 2>/dev/null || echo "No test logs found"; \
else \
echo "No logs directory found"; \
fi
# Cleanup
clean:
@echo "π§Ή Cleaning up test artifacts..."
rm -rf __pycache__ .pytest_cache .coverage
find . -name "*.pyc" -delete
find . -name "*.pyo" -delete
find . -name ".DS_Store" -delete
@echo "β
Cleanup complete"
clean-reports:
@echo "ποΈ Cleaning up old reports..."
@if [ -d reports ]; then \
find reports/ -name "*.html" -mtime +7 -delete; \
find reports/ -name "*.json" -mtime +7 -delete; \
find reports/ -name "*.xml" -mtime +7 -delete; \
echo "β
Old reports cleaned up"; \
fi
clean-all: clean clean-reports docker-clean
@echo "π§Ή Full cleanup complete"
# Help for specific components
help-docker:
@echo "π³ Docker Commands:"
@echo " make docker-up - Start PostgreSQL, Redis, and N8N containers"
@echo " make docker-down - Stop all containers"
@echo " make docker-clean - Remove all containers and volumes"
help-testing:
@echo "π§ͺ Testing Commands:"
@echo " make test - Run all tests with reports"
@echo " make test-agents - Test agent management only"
@echo " make test-workflows - Test workflow orchestration only"
@echo " make test-security - Run security tests only"
@echo " make ci-test - Run CI/CD pipeline tests"
# Version info
version:
@echo "π§ͺ Automotas AI Testing Framework"
@python -c "from framework import __version__; print(f'Version: {__version__}')"
@python --version
@echo "Dependencies:"
@pip list | grep -E "(pytest|aiohttp|requests)"