-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_ralph.sh
More file actions
91 lines (79 loc) · 1.89 KB
/
test_ralph.sh
File metadata and controls
91 lines (79 loc) · 1.89 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
#!/bin/bash
# Simple tests for ralph container setup
set -e
echo "=== Ralph Container Tests ==="
# Test 1: Check sudo access
echo -n "Test 1: Sudo access... "
if sudo whoami | grep -q "root"; then
echo "PASS"
else
echo "FAIL"
exit 1
fi
# Test 2: Check Claude CLI is installed
echo -n "Test 2: Claude CLI installed... "
if command -v claude &> /dev/null; then
echo "PASS"
else
echo "FAIL"
exit 1
fi
# Test 3: Check entrypoint exists
echo -n "Test 3: Entrypoint script exists... "
if [ -x /usr/local/bin/entrypoint.sh ]; then
echo "PASS"
else
echo "FAIL"
exit 1
fi
# Test 4: Check workspace directory exists
echo -n "Test 4: Workspace directory exists... "
if [ -d /workspace ]; then
echo "PASS"
else
echo "FAIL"
exit 1
fi
# Test 5: Check user is ralph
echo -n "Test 5: Running as ralph user... "
if [ "$(whoami)" = "ralph" ]; then
echo "PASS"
else
echo "FAIL"
exit 1
fi
# Test 6: Check bash is available
echo -n "Test 6: Bash available... "
if command -v bash &> /dev/null; then
echo "PASS"
else
echo "FAIL"
exit 1
fi
# Test 7: Check Playwright Chromium browser installed
echo -n "Test 7: Playwright Chromium installed... "
CHROME_BIN="$(find "${PLAYWRIGHT_BROWSERS_PATH}" -name "chrome" -path "*/chromium-*/chrome-linux*/chrome" -type f 2>/dev/null | head -1)"
if [ -n "$CHROME_BIN" ] && [ -x "$CHROME_BIN" ]; then
echo "PASS"
else
echo "FAIL (no chrome binary found under ${PLAYWRIGHT_BROWSERS_PATH})"
exit 1
fi
# Test 8: Check Chromium version executes
echo -n "Test 8: Chromium version check... "
if "$CHROME_BIN" --version &> /dev/null; then
echo "PASS"
else
echo "FAIL"
exit 1
fi
# Test 9: Check Playwright MCP package installed
echo -n "Test 9: Playwright MCP package installed... "
if npm ls -g @playwright/mcp &> /dev/null; then
echo "PASS"
else
echo "FAIL"
exit 1
fi
echo ""
echo "=== All 9 tests passed ==="