Skip to content

Commit 7bb002a

Browse files
ellyxirjakedahn
andauthored
Ellyse/smoketest mac (#1972)
* get key from keychain when on mac * fix playwright permissions on mac * work for SELinux * fix flags for mcp playwright * adding a platform flag for docker to run on mac * back again to chrome Co-authored-by: jakedahn <jake@common.tools>
1 parent 24a492d commit 7bb002a

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

tools/ralph/bin/run_smoketest.sh

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,37 @@ done
3838
# Run smoketests
3939
for ID in $RALPH_IDS; do
4040
echo "Starting smoketest for RALPH_ID=$ID"
41-
docker run --rm -e RALPH_ID=$ID -d \
41+
docker run --platform linux/amd64 --rm -e RALPH_ID=$ID -d \
4242
-u $(id -u):$(id -g) \
4343
-e HOME=/tmp/home \
44-
-v "$LABS:/app/labs" \
45-
-v "$LABS/tools/ralph/smoketest:/app/smoketest" \
44+
-v "$LABS:/app/labs:z" \
45+
-v "$LABS/tools/ralph/smoketest:/app/smoketest:z" \
46+
--cap-add=SYS_ADMIN \
47+
--security-opt seccomp=unconfined \
48+
--shm-size=2g \
4649
--name ralph_$ID \
4750
ellyxir/ralph
4851

4952
# Copy Claude credentials into container's writable /tmp/home
5053
# Each container gets its own copy to avoid conflicts
5154
docker exec ralph_$ID mkdir -p /tmp/home/.claude
5255
docker cp ~/.claude.json ralph_$ID:/tmp/home/.claude.json
53-
docker cp ~/.claude/.credentials.json ralph_$ID:/tmp/home/.claude/.credentials.json
56+
57+
# Handle credentials based on platform
58+
if [[ "$OSTYPE" == "darwin"* ]]; then
59+
# macOS: Extract credentials from keychain
60+
echo "Extracting credentials from macOS keychain..."
61+
CREDS=$(security find-generic-password -s "Claude Code-credentials" -w 2>/dev/null)
62+
if [ -n "$CREDS" ]; then
63+
echo "$CREDS" | docker exec -i ralph_$ID tee /tmp/home/.claude/.credentials.json > /dev/null
64+
echo "Credentials copied from keychain for ralph_$ID"
65+
else
66+
echo "Warning: Could not find credentials in keychain for ralph_$ID"
67+
fi
68+
else
69+
# Linux/other: Copy from file
70+
docker cp ~/.claude/.credentials.json ralph_$ID:/tmp/home/.claude/.credentials.json
71+
fi
5472

5573
# Configure Claude MCP server for Playwright
5674
# Container runs as host user with HOME=/tmp/home

0 commit comments

Comments
 (0)