Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ dist/
downloads/
eggs/
.eggs/
lib/
# lib/ is ignored but allow specific paths (exceptions below)
*/lib/
lib64/

# Exception: Include plugin and skill script libraries
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: docker-sandbox
name: claude-isolated-test
description: Use when testing Claude Code components (SKILLs, Commands, Hooks) in isolated Docker environments, needing reproducible test conditions, or testing without polluting local environment
---

# Docker Sandbox Testing
# Claude Isolated Testing

## Overview

Expand Down Expand Up @@ -418,7 +418,7 @@ ENTRYPOINT ["/usr/bin/env", "bash"]

## Comparison with tmux-testing

| Feature | docker-sandbox | tmux-testing |
| Feature | claude-isolated-test | tmux-testing |
|---------|----------------|--------------|
| **Isolation** | Full OS isolation | Process isolation |
| **TTY** | No (unless combined) | Yes |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fi
# 2. Check if image exists, build if needed
if ! docker image inspect "$IMAGE_NAME" &>/dev/null; then
echo "Image not found. Building $IMAGE_NAME..." >&2
build_claude_image "$IMAGE_NAME" "$PROJECT_ROOT/skills/docker-sandbox/docker"
build_claude_image "$IMAGE_NAME" "$SCRIPT_DIR/../docker"
fi

# 3. Get OAuth token from Keychain (macOS) or environment
Expand Down
20 changes: 10 additions & 10 deletions tests/docker-sandbox.bats → tests/claude-isolated-test.bats
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env bats
# docker-sandbox.bats: Tests for docker-sandbox skill
# claude-isolated-test.bats: Tests for claude-isolated-test skill

load 'helpers/bats_helper.bash'

setup() {
# Source the helper libraries
DOCKER_SANDBOX_DIR="${BATS_TEST_DIRNAME}/../skills/docker-sandbox"
export DOCKER_SANDBOX_DIR
CLAUDE_ISOLATED_TEST_DIR="${BATS_TEST_DIRNAME}/../plugins/me/skills/claude-isolated-test"
export CLAUDE_ISOLATED_TEST_DIR
}

teardown() {
Expand All @@ -20,7 +20,7 @@ teardown() {
skip "Docker not available"
fi

source "$DOCKER_SANDBOX_DIR/scripts/lib/docker-helpers.sh"
source "$CLAUDE_ISOLATED_TEST_DIR/scripts/lib/docker-helpers.sh"

run check_docker_available
[ "$status" -eq 0 ]
Expand All @@ -34,7 +34,7 @@ teardown() {
}
export -f docker

source "$DOCKER_SANDBOX_DIR/scripts/lib/docker-helpers.sh"
source "$CLAUDE_ISOLATED_TEST_DIR/scripts/lib/docker-helpers.sh"

run check_docker_available
[ "$status" -ne 0 ]
Expand All @@ -48,7 +48,7 @@ teardown() {
skip "Docker not available"
fi

source "$DOCKER_SANDBOX_DIR/scripts/lib/docker-helpers.sh"
source "$CLAUDE_ISOLATED_TEST_DIR/scripts/lib/docker-helpers.sh"

local container_name="claude-test-bats-$$-$RANDOM"
local test_token="test-token-12345"
Expand All @@ -72,7 +72,7 @@ teardown() {
}

@test "test-helpers.sh: verify_contains checks all expected strings" {
source "$DOCKER_SANDBOX_DIR/scripts/lib/test-helpers.sh"
source "$CLAUDE_ISOLATED_TEST_DIR/scripts/lib/test-helpers.sh"

local output="This is a test output with multiple lines"

Expand All @@ -84,7 +84,7 @@ teardown() {
}

@test "run-docker-test.sh: script exists and is executable" {
local script="$DOCKER_SANDBOX_DIR/scripts/run-docker-test.sh"
local script="$CLAUDE_ISOLATED_TEST_DIR/scripts/run-docker-test.sh"

[ -f "$script" ]
[ -x "$script" ]
Expand All @@ -95,7 +95,7 @@ teardown() {
skip "Docker not available"
fi

local script="$DOCKER_SANDBOX_DIR/scripts/run-docker-test.sh"
local script="$CLAUDE_ISOLATED_TEST_DIR/scripts/run-docker-test.sh"

run "$script"
[ "$status" -ne 0 ]
Expand All @@ -107,7 +107,7 @@ teardown() {
skip "Docker not available"
fi

local script="$DOCKER_SANDBOX_DIR/scripts/run-docker-test.sh"
local script="$CLAUDE_ISOLATED_TEST_DIR/scripts/run-docker-test.sh"

run "$script" "/nonexistent/test.yaml"
[ "$status" -ne 0 ]
Expand Down
Loading