cyclecad 3.2.1 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +155 -1
- package/DOCKER-SETUP-VERIFICATION.md +399 -0
- package/DOCKER-TESTING.md +463 -0
- package/FUSION360_MODULES.md +478 -0
- package/FUSION_MODULES_README.md +352 -0
- package/INTEGRATION_SNIPPETS.md +608 -0
- package/KILLER-FEATURES-DELIVERY.md +469 -0
- package/MODULES_SUMMARY.txt +337 -0
- package/QUICK_REFERENCE.txt +298 -0
- package/README-DOCKER-TESTING.txt +438 -0
- package/app/index.html +23 -10
- package/app/js/fusion-help.json +1808 -0
- package/app/js/help-module-v3.js +1096 -0
- package/app/js/killer-features-help.json +395 -0
- package/app/js/killer-features.js +1508 -0
- package/app/js/modules/fusion-assembly.js +842 -0
- package/app/js/modules/fusion-cam.js +785 -0
- package/app/js/modules/fusion-data.js +814 -0
- package/app/js/modules/fusion-drawing.js +844 -0
- package/app/js/modules/fusion-inspection.js +756 -0
- package/app/js/modules/fusion-render.js +774 -0
- package/app/js/modules/fusion-simulation.js +986 -0
- package/app/js/modules/fusion-sketch.js +1044 -0
- package/app/js/modules/fusion-solid.js +1095 -0
- package/app/js/modules/fusion-surface.js +949 -0
- package/app/tests/FUSION_TEST_SUITE.md +266 -0
- package/app/tests/README.md +77 -0
- package/app/tests/TESTING-CHECKLIST.md +177 -0
- package/app/tests/TEST_SUITE_SUMMARY.txt +236 -0
- package/app/tests/brep-live-test.html +848 -0
- package/app/tests/docker-integration-test.html +811 -0
- package/app/tests/fusion-all-tests.html +670 -0
- package/app/tests/fusion-assembly-tests.html +461 -0
- package/app/tests/fusion-cam-tests.html +421 -0
- package/app/tests/fusion-simulation-tests.html +421 -0
- package/app/tests/fusion-sketch-tests.html +613 -0
- package/app/tests/fusion-solid-tests.html +529 -0
- package/app/tests/index.html +453 -0
- package/app/tests/killer-features-test.html +509 -0
- package/app/tests/run-tests.html +874 -0
- package/app/tests/step-import-live-test.html +1115 -0
- package/app/tests/test-agent-v3.html +93 -696
- package/architecture-dashboard.html +1970 -0
- package/docs/API-REFERENCE.md +1423 -0
- package/docs/BREP-LIVE-TEST-GUIDE.md +453 -0
- package/docs/DEVELOPER-GUIDE-v3.md +795 -0
- package/docs/DOCKER-QUICK-TEST.md +376 -0
- package/docs/FUSION-FEATURES-GUIDE.md +2513 -0
- package/docs/FUSION-TUTORIAL.md +1203 -0
- package/docs/INFRASTRUCTURE-GUIDE-INDEX.md +327 -0
- package/docs/KEYBOARD-SHORTCUTS.md +402 -0
- package/docs/KILLER-FEATURES-INTEGRATION.md +412 -0
- package/docs/KILLER-FEATURES-SUMMARY.md +424 -0
- package/docs/KILLER-FEATURES-TUTORIAL.md +784 -0
- package/docs/KILLER-FEATURES.md +562 -0
- package/docs/QUICK-REFERENCE.md +282 -0
- package/docs/README-v3-DOCS.md +274 -0
- package/docs/TUTORIAL-v3.md +1190 -0
- package/docs/architecture-dashboard.html +1970 -0
- package/docs/architecture-v3.html +1038 -0
- package/linkedin-post-v3.md +58 -0
- package/package.json +1 -1
- package/scripts/dev-setup.sh +338 -0
- package/scripts/docker-health-check.sh +159 -0
- package/scripts/integration-test.sh +311 -0
- package/scripts/test-docker.sh +515 -0
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
################################################################################
|
|
4
|
+
# cycleCAD Docker Compose Test Script
|
|
5
|
+
#
|
|
6
|
+
# Comprehensive testing of Docker infrastructure:
|
|
7
|
+
# - Checks prerequisites (docker, docker-compose, curl)
|
|
8
|
+
# - Builds all images
|
|
9
|
+
# - Starts services and waits for health checks
|
|
10
|
+
# - Tests each endpoint
|
|
11
|
+
# - Reports pass/fail status
|
|
12
|
+
# - Cleans up on exit
|
|
13
|
+
#
|
|
14
|
+
# Usage:
|
|
15
|
+
# ./scripts/test-docker.sh # Run full test suite
|
|
16
|
+
# ./scripts/test-docker.sh --skip-build # Skip build, test running containers
|
|
17
|
+
# ./scripts/test-docker.sh --cleanup # Stop and remove containers
|
|
18
|
+
# ./scripts/test-docker.sh --logs # View real-time logs
|
|
19
|
+
################################################################################
|
|
20
|
+
|
|
21
|
+
set -e
|
|
22
|
+
|
|
23
|
+
# Colors for output
|
|
24
|
+
RED='\033[0;31m'
|
|
25
|
+
GREEN='\033[0;32m'
|
|
26
|
+
YELLOW='\033[1;33m'
|
|
27
|
+
BLUE='\033[0;34m'
|
|
28
|
+
NC='\033[0m' # No Color
|
|
29
|
+
|
|
30
|
+
# Global counters
|
|
31
|
+
TESTS_PASSED=0
|
|
32
|
+
TESTS_FAILED=0
|
|
33
|
+
TESTS_SKIPPED=0
|
|
34
|
+
|
|
35
|
+
# Configuration
|
|
36
|
+
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
37
|
+
TIMEOUT=120 # seconds to wait for services
|
|
38
|
+
SKIP_BUILD=false
|
|
39
|
+
CLEANUP_ONLY=false
|
|
40
|
+
LOGS_ONLY=false
|
|
41
|
+
|
|
42
|
+
################################################################################
|
|
43
|
+
# Helper Functions
|
|
44
|
+
################################################################################
|
|
45
|
+
|
|
46
|
+
print_header() {
|
|
47
|
+
echo ""
|
|
48
|
+
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
49
|
+
echo -e "${BLUE}$1${NC}"
|
|
50
|
+
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
51
|
+
echo ""
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
print_test() {
|
|
55
|
+
echo -ne "${YELLOW}→${NC} $1... "
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
pass() {
|
|
59
|
+
echo -e "${GREEN}✓ PASS${NC}"
|
|
60
|
+
((TESTS_PASSED++))
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
fail() {
|
|
64
|
+
echo -e "${RED}✗ FAIL${NC}: $1"
|
|
65
|
+
((TESTS_FAILED++))
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
skip() {
|
|
69
|
+
echo -e "${YELLOW}⊘ SKIP${NC}: $1"
|
|
70
|
+
((TESTS_SKIPPED++))
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
command_exists() {
|
|
74
|
+
command -v "$1" >/dev/null 2>&1
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
wait_for_port() {
|
|
78
|
+
local port=$1
|
|
79
|
+
local timeout=$2
|
|
80
|
+
local elapsed=0
|
|
81
|
+
|
|
82
|
+
while [ $elapsed -lt $timeout ]; do
|
|
83
|
+
if timeout 1 bash -c "echo >/dev/tcp/localhost/$port" 2>/dev/null; then
|
|
84
|
+
return 0
|
|
85
|
+
fi
|
|
86
|
+
sleep 1
|
|
87
|
+
((elapsed++))
|
|
88
|
+
done
|
|
89
|
+
return 1
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
wait_for_health() {
|
|
93
|
+
local url=$1
|
|
94
|
+
local timeout=$2
|
|
95
|
+
local elapsed=0
|
|
96
|
+
|
|
97
|
+
while [ $elapsed -lt $timeout ]; do
|
|
98
|
+
if curl -sf "$url" >/dev/null 2>&1; then
|
|
99
|
+
return 0
|
|
100
|
+
fi
|
|
101
|
+
sleep 1
|
|
102
|
+
((elapsed++))
|
|
103
|
+
done
|
|
104
|
+
return 1
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
print_summary() {
|
|
108
|
+
echo ""
|
|
109
|
+
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
110
|
+
echo -e "${BLUE}TEST SUMMARY${NC}"
|
|
111
|
+
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
112
|
+
|
|
113
|
+
echo ""
|
|
114
|
+
if [ $TESTS_FAILED -eq 0 ]; then
|
|
115
|
+
echo -e "${GREEN}✓ All tests passed!${NC}"
|
|
116
|
+
else
|
|
117
|
+
echo -e "${RED}✗ $TESTS_FAILED test(s) failed${NC}"
|
|
118
|
+
fi
|
|
119
|
+
|
|
120
|
+
echo ""
|
|
121
|
+
echo "Results:"
|
|
122
|
+
echo -e " ${GREEN}Passed:${NC} $TESTS_PASSED"
|
|
123
|
+
echo -e " ${RED}Failed:${NC} $TESTS_FAILED"
|
|
124
|
+
echo -e " ${YELLOW}Skipped:${NC} $TESTS_SKIPPED"
|
|
125
|
+
echo ""
|
|
126
|
+
|
|
127
|
+
if [ $TESTS_FAILED -eq 0 ]; then
|
|
128
|
+
return 0
|
|
129
|
+
else
|
|
130
|
+
return 1
|
|
131
|
+
fi
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
################################################################################
|
|
135
|
+
# Main Testing Functions
|
|
136
|
+
################################################################################
|
|
137
|
+
|
|
138
|
+
check_prerequisites() {
|
|
139
|
+
print_header "CHECKING PREREQUISITES"
|
|
140
|
+
|
|
141
|
+
print_test "Docker installed"
|
|
142
|
+
if command_exists docker; then
|
|
143
|
+
pass
|
|
144
|
+
else
|
|
145
|
+
fail "Docker not found. Install from https://www.docker.com/products/docker-desktop"
|
|
146
|
+
exit 1
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
print_test "docker-compose installed"
|
|
150
|
+
if command_exists docker-compose; then
|
|
151
|
+
pass
|
|
152
|
+
else
|
|
153
|
+
fail "docker-compose not found. Install via: pip install docker-compose"
|
|
154
|
+
exit 1
|
|
155
|
+
fi
|
|
156
|
+
|
|
157
|
+
print_test "Docker daemon running"
|
|
158
|
+
if docker info >/dev/null 2>&1; then
|
|
159
|
+
pass
|
|
160
|
+
else
|
|
161
|
+
fail "Docker daemon not running. Start Docker Desktop or 'sudo systemctl start docker'"
|
|
162
|
+
exit 1
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
print_test "curl installed"
|
|
166
|
+
if command_exists curl; then
|
|
167
|
+
pass
|
|
168
|
+
else
|
|
169
|
+
fail "curl not found"
|
|
170
|
+
exit 1
|
|
171
|
+
fi
|
|
172
|
+
|
|
173
|
+
print_test "Required ports free (8080, 8787, 8788)"
|
|
174
|
+
local ports_free=true
|
|
175
|
+
for port in 8080 8787 8788; do
|
|
176
|
+
if ! timeout 1 bash -c "echo >/dev/tcp/localhost/$port" 2>/dev/null; then
|
|
177
|
+
ports_free=true
|
|
178
|
+
else
|
|
179
|
+
ports_free=false
|
|
180
|
+
fail "Port $port is already in use"
|
|
181
|
+
fi
|
|
182
|
+
done
|
|
183
|
+
if [ "$ports_free" = true ]; then
|
|
184
|
+
pass
|
|
185
|
+
fi
|
|
186
|
+
|
|
187
|
+
print_test "Sufficient disk space (2GB available)"
|
|
188
|
+
if command_exists df; then
|
|
189
|
+
local available=$(df "$REPO_ROOT" | awk 'NR==2 {print $4}')
|
|
190
|
+
if [ "$available" -gt 2097152 ]; then
|
|
191
|
+
pass
|
|
192
|
+
else
|
|
193
|
+
fail "Less than 2GB free space available"
|
|
194
|
+
fi
|
|
195
|
+
else
|
|
196
|
+
skip "df command not available"
|
|
197
|
+
fi
|
|
198
|
+
|
|
199
|
+
print_test "Docker memory sufficient (8GB recommended)"
|
|
200
|
+
if command_exists docker; then
|
|
201
|
+
local memory=$(docker info 2>/dev/null | grep "Memory:" | awk '{print $2}')
|
|
202
|
+
if [ ! -z "$memory" ] && [ "$memory" -gt 8000000000 ]; then
|
|
203
|
+
pass
|
|
204
|
+
else
|
|
205
|
+
skip "Cannot verify Docker memory (may be insufficient for large STEP files)"
|
|
206
|
+
fi
|
|
207
|
+
fi
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
stop_services() {
|
|
211
|
+
print_header "STOPPING EXISTING SERVICES"
|
|
212
|
+
|
|
213
|
+
print_test "Stop docker-compose services"
|
|
214
|
+
if cd "$REPO_ROOT" && docker-compose down 2>/dev/null; then
|
|
215
|
+
pass
|
|
216
|
+
else
|
|
217
|
+
skip "No running services to stop"
|
|
218
|
+
fi
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
build_images() {
|
|
222
|
+
if [ "$SKIP_BUILD" = true ]; then
|
|
223
|
+
print_header "SKIPPING IMAGE BUILD (--skip-build)"
|
|
224
|
+
return
|
|
225
|
+
fi
|
|
226
|
+
|
|
227
|
+
print_header "BUILDING DOCKER IMAGES"
|
|
228
|
+
|
|
229
|
+
print_test "Build all images"
|
|
230
|
+
if cd "$REPO_ROOT" && docker-compose build 2>/dev/null; then
|
|
231
|
+
pass
|
|
232
|
+
else
|
|
233
|
+
fail "Failed to build images"
|
|
234
|
+
return 1
|
|
235
|
+
fi
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
start_services() {
|
|
239
|
+
print_header "STARTING SERVICES"
|
|
240
|
+
|
|
241
|
+
print_test "Start docker-compose (background)"
|
|
242
|
+
if cd "$REPO_ROOT" && docker-compose up -d 2>/dev/null; then
|
|
243
|
+
pass
|
|
244
|
+
else
|
|
245
|
+
fail "Failed to start docker-compose"
|
|
246
|
+
return 1
|
|
247
|
+
fi
|
|
248
|
+
|
|
249
|
+
# Wait for containers to start
|
|
250
|
+
sleep 2
|
|
251
|
+
|
|
252
|
+
print_test "Wait for cyclecad app to be healthy"
|
|
253
|
+
if wait_for_health "http://localhost:8080/health" $TIMEOUT 2>/dev/null; then
|
|
254
|
+
pass
|
|
255
|
+
else
|
|
256
|
+
fail "cyclecad app failed health check"
|
|
257
|
+
docker-compose logs cyclecad | head -20
|
|
258
|
+
fi
|
|
259
|
+
|
|
260
|
+
print_test "Wait for converter to be healthy"
|
|
261
|
+
if wait_for_health "http://localhost:8787/health" $TIMEOUT 2>/dev/null; then
|
|
262
|
+
pass
|
|
263
|
+
else
|
|
264
|
+
fail "converter service failed health check"
|
|
265
|
+
docker-compose logs converter | head -20
|
|
266
|
+
fi
|
|
267
|
+
|
|
268
|
+
print_test "Wait for signaling to be healthy"
|
|
269
|
+
if wait_for_health "http://localhost:8788/health" $TIMEOUT 2>/dev/null; then
|
|
270
|
+
pass
|
|
271
|
+
else
|
|
272
|
+
fail "signaling service failed health check"
|
|
273
|
+
docker-compose logs signaling | head -20
|
|
274
|
+
fi
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
test_web_app() {
|
|
278
|
+
print_header "TESTING WEB APPLICATION"
|
|
279
|
+
|
|
280
|
+
print_test "HTTP GET /app/"
|
|
281
|
+
local response=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/app/)
|
|
282
|
+
if [ "$response" = "200" ]; then
|
|
283
|
+
pass
|
|
284
|
+
else
|
|
285
|
+
fail "Got HTTP $response (expected 200)"
|
|
286
|
+
fi
|
|
287
|
+
|
|
288
|
+
print_test "Health endpoint /health"
|
|
289
|
+
if curl -sf http://localhost:8080/health | grep -q '"status"'; then
|
|
290
|
+
pass
|
|
291
|
+
else
|
|
292
|
+
fail "Health endpoint not responding"
|
|
293
|
+
fi
|
|
294
|
+
|
|
295
|
+
print_test "Content-Type is text/html"
|
|
296
|
+
local content_type=$(curl -s -I http://localhost:8080/app/ | grep -i content-type | cut -d' ' -f2-)
|
|
297
|
+
if [[ "$content_type" == *"text/html"* ]]; then
|
|
298
|
+
pass
|
|
299
|
+
else
|
|
300
|
+
skip "Content-Type check (got: $content_type)"
|
|
301
|
+
fi
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
test_converter() {
|
|
305
|
+
print_header "TESTING CONVERTER SERVICE"
|
|
306
|
+
|
|
307
|
+
print_test "Health endpoint /health"
|
|
308
|
+
local response=$(curl -s http://localhost:8787/health)
|
|
309
|
+
if echo "$response" | grep -q '"status"'; then
|
|
310
|
+
pass
|
|
311
|
+
else
|
|
312
|
+
fail "Health endpoint not responding with JSON"
|
|
313
|
+
fi
|
|
314
|
+
|
|
315
|
+
print_test "Converter listening on port 8787"
|
|
316
|
+
if wait_for_port 8787 5; then
|
|
317
|
+
pass
|
|
318
|
+
else
|
|
319
|
+
fail "Port 8787 not responding"
|
|
320
|
+
fi
|
|
321
|
+
|
|
322
|
+
print_test "Health check includes queue status"
|
|
323
|
+
if curl -s http://localhost:8787/health | grep -q '"queue"'; then
|
|
324
|
+
pass
|
|
325
|
+
else
|
|
326
|
+
skip "Queue status not in health response"
|
|
327
|
+
fi
|
|
328
|
+
|
|
329
|
+
print_test "POST /convert endpoint responds"
|
|
330
|
+
local response=$(curl -s -o /dev/null -w "%{http_code}" -X POST http://localhost:8787/convert -F "file=@/dev/null")
|
|
331
|
+
if [ "$response" != "404" ] && [ "$response" != "500" ]; then
|
|
332
|
+
pass
|
|
333
|
+
else
|
|
334
|
+
skip "POST /convert returned HTTP $response"
|
|
335
|
+
fi
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
test_signaling() {
|
|
339
|
+
print_header "TESTING SIGNALING SERVICE"
|
|
340
|
+
|
|
341
|
+
print_test "Health endpoint /health"
|
|
342
|
+
local response=$(curl -s http://localhost:8788/health)
|
|
343
|
+
if echo "$response" | grep -q '"status"'; then
|
|
344
|
+
pass
|
|
345
|
+
else
|
|
346
|
+
fail "Health endpoint not responding with JSON"
|
|
347
|
+
fi
|
|
348
|
+
|
|
349
|
+
print_test "Signaling listening on port 8788"
|
|
350
|
+
if wait_for_port 8788 5; then
|
|
351
|
+
pass
|
|
352
|
+
else
|
|
353
|
+
fail "Port 8788 not responding"
|
|
354
|
+
fi
|
|
355
|
+
|
|
356
|
+
print_test "Health check includes connections"
|
|
357
|
+
if curl -s http://localhost:8788/health | grep -q '"connections"'; then
|
|
358
|
+
pass
|
|
359
|
+
else
|
|
360
|
+
skip "Connections stat not in health response"
|
|
361
|
+
fi
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
test_connectivity() {
|
|
365
|
+
print_header "TESTING SERVICE-TO-SERVICE CONNECTIVITY"
|
|
366
|
+
|
|
367
|
+
print_test "App can reach converter internally"
|
|
368
|
+
if docker-compose exec cyclecad curl -sf http://converter:8787/health >/dev/null 2>&1; then
|
|
369
|
+
pass
|
|
370
|
+
else
|
|
371
|
+
skip "Cannot test internal connectivity (exec not available)"
|
|
372
|
+
fi
|
|
373
|
+
|
|
374
|
+
print_test "App can reach signaling internally"
|
|
375
|
+
if docker-compose exec cyclecad curl -sf http://signaling:8788/health >/dev/null 2>&1; then
|
|
376
|
+
pass
|
|
377
|
+
else
|
|
378
|
+
skip "Cannot test internal connectivity"
|
|
379
|
+
fi
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
test_container_health() {
|
|
383
|
+
print_header "TESTING CONTAINER HEALTH"
|
|
384
|
+
|
|
385
|
+
print_test "cyclecad container is healthy"
|
|
386
|
+
local status=$(docker-compose ps cyclecad 2>/dev/null | grep -i healthy | wc -l)
|
|
387
|
+
if [ $status -gt 0 ]; then
|
|
388
|
+
pass
|
|
389
|
+
else
|
|
390
|
+
fail "Container not reporting healthy status"
|
|
391
|
+
docker-compose ps
|
|
392
|
+
fi
|
|
393
|
+
|
|
394
|
+
print_test "converter container is healthy"
|
|
395
|
+
local status=$(docker-compose ps converter 2>/dev/null | grep -i healthy | wc -l)
|
|
396
|
+
if [ $status -gt 0 ]; then
|
|
397
|
+
pass
|
|
398
|
+
else
|
|
399
|
+
fail "Container not reporting healthy status"
|
|
400
|
+
docker-compose ps
|
|
401
|
+
fi
|
|
402
|
+
|
|
403
|
+
print_test "signaling container is healthy"
|
|
404
|
+
local status=$(docker-compose ps signaling 2>/dev/null | grep -i healthy | wc -l)
|
|
405
|
+
if [ $status -gt 0 ]; then
|
|
406
|
+
pass
|
|
407
|
+
else
|
|
408
|
+
fail "Container not reporting healthy status"
|
|
409
|
+
docker-compose ps
|
|
410
|
+
fi
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
show_logs() {
|
|
414
|
+
print_header "FOLLOWING LIVE LOGS (Ctrl+C to exit)"
|
|
415
|
+
echo ""
|
|
416
|
+
cd "$REPO_ROOT"
|
|
417
|
+
docker-compose logs -f
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
################################################################################
|
|
421
|
+
# Main Script
|
|
422
|
+
################################################################################
|
|
423
|
+
|
|
424
|
+
main() {
|
|
425
|
+
# Parse command-line arguments
|
|
426
|
+
while [ $# -gt 0 ]; do
|
|
427
|
+
case "$1" in
|
|
428
|
+
--skip-build)
|
|
429
|
+
SKIP_BUILD=true
|
|
430
|
+
shift
|
|
431
|
+
;;
|
|
432
|
+
--cleanup)
|
|
433
|
+
CLEANUP_ONLY=true
|
|
434
|
+
shift
|
|
435
|
+
;;
|
|
436
|
+
--logs)
|
|
437
|
+
LOGS_ONLY=true
|
|
438
|
+
shift
|
|
439
|
+
;;
|
|
440
|
+
--help)
|
|
441
|
+
echo "Usage: $0 [OPTIONS]"
|
|
442
|
+
echo ""
|
|
443
|
+
echo "Options:"
|
|
444
|
+
echo " --skip-build Skip docker-compose build (test running containers)"
|
|
445
|
+
echo " --cleanup Stop and remove all containers"
|
|
446
|
+
echo " --logs Follow live logs (docker-compose logs -f)"
|
|
447
|
+
echo " --help Show this help message"
|
|
448
|
+
echo ""
|
|
449
|
+
exit 0
|
|
450
|
+
;;
|
|
451
|
+
*)
|
|
452
|
+
echo "Unknown option: $1"
|
|
453
|
+
echo "Run '$0 --help' for usage"
|
|
454
|
+
exit 1
|
|
455
|
+
;;
|
|
456
|
+
esac
|
|
457
|
+
done
|
|
458
|
+
|
|
459
|
+
# Handle special modes
|
|
460
|
+
if [ "$CLEANUP_ONLY" = true ]; then
|
|
461
|
+
print_header "CLEANUP MODE"
|
|
462
|
+
stop_services
|
|
463
|
+
echo -e "${GREEN}✓ All containers stopped and removed${NC}"
|
|
464
|
+
exit 0
|
|
465
|
+
fi
|
|
466
|
+
|
|
467
|
+
if [ "$LOGS_ONLY" = true ]; then
|
|
468
|
+
show_logs
|
|
469
|
+
exit 0
|
|
470
|
+
fi
|
|
471
|
+
|
|
472
|
+
# Normal test mode
|
|
473
|
+
echo ""
|
|
474
|
+
echo -e "${BLUE}╔═══════════════════════════════════════════════════╗${NC}"
|
|
475
|
+
echo -e "${BLUE}║ cycleCAD Docker Compose Test Suite ║${NC}"
|
|
476
|
+
echo -e "${BLUE}║ Comprehensive Infrastructure Testing ║${NC}"
|
|
477
|
+
echo -e "${BLUE}╚═══════════════════════════════════════════════════╝${NC}"
|
|
478
|
+
echo ""
|
|
479
|
+
|
|
480
|
+
check_prerequisites
|
|
481
|
+
stop_services
|
|
482
|
+
build_images
|
|
483
|
+
start_services
|
|
484
|
+
test_web_app
|
|
485
|
+
test_converter
|
|
486
|
+
test_signaling
|
|
487
|
+
test_connectivity
|
|
488
|
+
test_container_health
|
|
489
|
+
|
|
490
|
+
# Print summary
|
|
491
|
+
if print_summary; then
|
|
492
|
+
echo -e "${GREEN}All tests passed! Services are running correctly.${NC}"
|
|
493
|
+
echo ""
|
|
494
|
+
echo "Next steps:"
|
|
495
|
+
echo " • Open http://localhost:8080/app/ in your browser"
|
|
496
|
+
echo " • View logs: docker-compose logs -f"
|
|
497
|
+
echo " • Stop services: docker-compose down"
|
|
498
|
+
echo ""
|
|
499
|
+
exit 0
|
|
500
|
+
else
|
|
501
|
+
echo -e "${RED}Some tests failed. Check logs above for details.${NC}"
|
|
502
|
+
echo ""
|
|
503
|
+
echo "Debugging tips:"
|
|
504
|
+
echo " • View full logs: docker-compose logs --tail 100"
|
|
505
|
+
echo " • Check service status: docker-compose ps"
|
|
506
|
+
echo " • Shell into service: docker-compose exec cyclecad sh"
|
|
507
|
+
echo ""
|
|
508
|
+
exit 1
|
|
509
|
+
fi
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
# Run main function if script is executed directly
|
|
513
|
+
if [ "${BASH_SOURCE[0]}" == "${0}" ]; then
|
|
514
|
+
main "$@"
|
|
515
|
+
fi
|