-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_docker.sh
More file actions
56 lines (46 loc) · 1.16 KB
/
test_docker.sh
File metadata and controls
56 lines (46 loc) · 1.16 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
#!/usr/bin/env bash
# Test script for Docker image build and basic operations
set -euo pipefail
IMAGE_NAME="icron-test"
echo "=== Building Docker image ==="
docker build -t "$IMAGE_NAME" .
echo ""
echo "=== Running 'icron onboard' ==="
docker run --name icron-test-run "$IMAGE_NAME" onboard
echo ""
echo "=== Running 'icron status' ==="
STATUS_OUTPUT=$(docker commit icron-test-run icron-test-onboarded > /dev/null && \
docker run --rm icron-test-onboarded status 2>&1) || true
echo "$STATUS_OUTPUT"
echo ""
echo "=== Validating output ==="
PASS=true
check() {
if echo "$STATUS_OUTPUT" | grep -q "$1"; then
echo " PASS: found '$1'"
else
echo " FAIL: missing '$1'"
PASS=false
fi
}
check "icron Status"
check "Config:"
check "Workspace:"
check "Model:"
check "OpenRouter API:"
check "Anthropic API:"
check "OpenAI API:"
echo ""
if $PASS; then
echo "=== All checks passed ==="
else
echo "=== Some checks FAILED ==="
exit 1
fi
# Cleanup
echo ""
echo "=== Cleanup ==="
docker rm -f icron-test-run 2>/dev/null || true
docker rmi -f icron-test-onboarded 2>/dev/null || true
docker rmi -f "$IMAGE_NAME" 2>/dev/null || true
echo "Done."