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
82 changes: 82 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Integration Test

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

permissions:
contents: read

jobs:
vhs-test:
runs-on: ubuntu-latest
env:
CGO_ENABLED: 0
AWS_ENDPOINT_URL: http://localhost:4566
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
AWS_EC2_METADATA_DISABLED: "true"
steps:
- uses: actions/checkout@v6

- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache: true

- name: Build
run: go build -o claws ./cmd/claws

- name: Start LocalStack
run: |
docker run -d --name localstack -p 4566:4566 localstack/localstack:4.12.0
echo "Waiting for LocalStack..."
for i in $(seq 1 30); do
if curl -s http://localhost:4566/_localstack/health | grep -qE '"s3": "(available|running)"'; then
echo "LocalStack is ready"
exit 0
fi
sleep 1
done
echo "LocalStack failed to start"
exit 1

- name: Setup demo data
timeout-minutes: 5
run: ./scripts/localstack-demo-setup.sh

- name: Create AWS config for demo
run: |
mkdir -p ~/.aws
cp scripts/demo-aws-config/config ~/.aws/config
cp scripts/demo-aws-config/credentials ~/.aws/credentials

- name: Run VHS tapes
run: |
set -e
for tape in docs/tapes/*.tape; do
echo "=========================================="
echo "Running: $tape"
echo "=========================================="
docker run --rm --network host \
-v "$(pwd)":/vhs \
-v ~/.aws:/root/.aws:ro \
-e AWS_ENDPOINT_URL=http://localhost:4566 \
-e AWS_EC2_METADATA_DISABLED=true \
ghcr.io/charmbracelet/vhs "$tape"
done

- name: Upload screenshots on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: vhs-screenshots
path: docs/images/
retention-days: 7

- name: Cleanup LocalStack
if: always()
run: docker stop localstack || true
53 changes: 53 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ tasks:
cmds:
- task: demo:record:gif
- task: demo:record:themes
- task: demo:record:theme-light
- task: demo:record:features
- task: demo:record:command-mode

demo:record:gif:
desc: Record demo.gif only
Expand Down Expand Up @@ -154,6 +156,57 @@ tasks:
-e AWS_EC2_METADATA_DISABLED=true \
ghcr.io/charmbracelet/vhs docs/tapes/features.tape

demo:record:theme-light:
desc: Record light theme screenshot (requires white terminal background)
deps: [build, localstack:start, localstack:demo-setup]
preconditions:
- sh: '[ "$(uname -s)" = "Linux" ]'
msg: "demo:record requires Linux (--network host not supported on macOS/Windows)"
cmds:
- |
docker run --rm --network host \
-v "$(pwd)":/vhs \
-v "$(pwd)/scripts/demo-aws-config:/root/.aws:ro" \
-e AWS_ENDPOINT_URL=http://localhost:4566 \
-e AWS_EC2_METADATA_DISABLED=true \
ghcr.io/charmbracelet/vhs docs/tapes/theme-light.tape

demo:record:command-mode:
desc: Record command mode suggestion/completion test
deps: [build, localstack:start, localstack:demo-setup]
preconditions:
- sh: '[ "$(uname -s)" = "Linux" ]'
msg: "demo:record requires Linux (--network host not supported on macOS/Windows)"
cmds:
- |
docker run --rm --network host \
-v "$(pwd)":/vhs \
-v "$(pwd)/scripts/demo-aws-config:/root/.aws:ro" \
-e AWS_ENDPOINT_URL=http://localhost:4566 \
-e AWS_EC2_METADATA_DISABLED=true \
ghcr.io/charmbracelet/vhs docs/tapes/command-mode.tape

test:vhs:
desc: Run all VHS tapes as integration tests
deps: [build, localstack:start, localstack:demo-setup]
preconditions:
- sh: '[ "$(uname -s)" = "Linux" ]'
msg: "test:vhs requires Linux (--network host not supported on macOS/Windows)"
cmds:
- |
set -e
for tape in docs/tapes/*.tape; do
echo "=========================================="
echo "Running: $tape"
echo "=========================================="
docker run --rm --network host \
-v "$(pwd)":/vhs \
-v "$(pwd)/scripts/demo-aws-config:/root/.aws:ro" \
-e AWS_ENDPOINT_URL=http://localhost:4566 \
-e AWS_EC2_METADATA_DISABLED=true \
ghcr.io/charmbracelet/vhs "$tape"
done

test-localstack:
desc: Run integration tests with LocalStack
deps: [localstack:start]
Expand Down
Binary file modified docs/images/actions-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/cmd-suggest-ec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/cmd-suggest-ec2-c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/cmd-suggest-ec2-slash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/cmd-suggest-ec2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/cmd-tab-completion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/detail-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/multi-account-region.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/multi-profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/multi-region-data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/multi-region.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/resource-browser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/test-diff-after-tab.png
Binary file not shown.
Binary file removed docs/images/test-diff-after-tab2.png
Binary file not shown.
Binary file removed docs/images/test-diff-before-tab.png
Binary file not shown.
Binary file removed docs/images/test-diff.gif
Binary file not shown.
Binary file modified docs/images/theme-catppuccin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/theme-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/theme-dracula.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/theme-gruvbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/theme-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/theme-nord.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions docs/tapes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ This directory contains [VHS](https://github.com/charmbracelet/vhs) tape files f
|------|---------|--------|
| `demo.tape` | Main demo GIF | `docs/images/demo.gif` |
| `themes.tape` | Theme screenshots | `docs/images/theme-*.png` |
| `theme-light.tape` | Light theme (white bg) | `docs/images/theme-light.png` |
| `features.tape` | Feature screenshots | `docs/images/*.png` |
| `command-mode.tape` | Command suggestions/completion | `docs/images/cmd-*.png` |

## Usage (Recommended)

Expand All @@ -19,9 +21,14 @@ Use task commands from project root (requires Docker + Linux):
task demo:record

# Record individual items
task demo:record:gif # Main demo GIF only
task demo:record:themes # Theme screenshots only
task demo:record:features # Feature screenshots only
task demo:record:gif # Main demo GIF only
task demo:record:themes # Theme screenshots only
task demo:record:theme-light # Light theme (requires white terminal bg)
task demo:record:features # Feature screenshots only
task demo:record:command-mode # Command mode tests

# Run all tapes as integration tests
task test:vhs
```

This automatically:
Expand Down
84 changes: 84 additions & 0 deletions docs/tapes/command-mode.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Command Mode Suggestion & Completion Test
# Tests command mode navigation, suggestions, tab completion, and enter behavior

Set FontSize 16
Set Width 1200
Set Height 600
Set TypingSpeed 0.08

Type "./claws"
Enter
Sleep 2s
Require "Services"

# --- Suggestion Tests ---

# ec → ec2 | ecr | ecs
Type ":"
Sleep 300ms
Type "ec"
Sleep 500ms
Require "ec2"
Require "ecr"
Require "ecs"
Screenshot docs/images/cmd-suggest-ec.png

# ec2 → ec2 (resolved)
Type "2"
Sleep 500ms
Screenshot docs/images/cmd-suggest-ec2.png

# ec2/ → ec2 | ec2/capacity-reservations | ...
Type "/"
Sleep 500ms
Require "ec2/capacity"
Screenshot docs/images/cmd-suggest-ec2-slash.png

# ec2/c → ec2/capacity-reservations
Type "c"
Sleep 500ms
Require "capacity-reservations"
Screenshot docs/images/cmd-suggest-ec2-c.png

Escape
Sleep 300ms

# --- Enter Navigation Tests ---

# ec Enter → ec2 service
Type ":ec"
Sleep 300ms
Enter
Sleep 2s
Require "ec2"

# ec2/ Enter → ec2 service
Type ":ec2/"
Sleep 300ms
Enter
Sleep 2s
Require "ec2"

# ec2/c Enter → ec2/capacity-reservations
Type ":ec2/c"
Sleep 300ms
Enter
Sleep 2s
Require "Capacity"

# --- Tab Completion Test ---

# ec2/c Tab → completes to ec2/capacity-reservations
Type ":"
Sleep 300ms
Type "ec2/c"
Sleep 300ms
Tab
Sleep 500ms
Require "ec2/capacity-reservations"
Screenshot docs/images/cmd-tab-completion.png
Escape
Sleep 300ms

Type "q"
Sleep 500ms
8 changes: 8 additions & 0 deletions docs/tapes/demo.tape
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,29 @@ Sleep 1.5s
Enter

Sleep 2.5s
Require "Services"

Type ":"
Sleep 1.5s
Type "vpc/subnets"
Sleep 1.5s
Enter
Sleep 2s
Require "Subnet ID"

Type "/web"
Sleep 1s
Enter
Sleep 2s
Require "web"

Type "m"
Sleep 1s
Type "G"
Sleep 1s
Type "d"
Sleep 3s
Require "Detail"
Escape
Sleep 1.5s

Expand All @@ -42,14 +46,17 @@ Type "ec2/instances"
Sleep 1.5s
Enter
Sleep 2s
Require "Instance ID"

Type "/running"
Sleep 1s
Enter
Sleep 2s
Require "running"

Type "a"
Sleep 2s
Require "Stop"
Type "S"
Sleep 1.5s
Type "y"
Expand All @@ -62,6 +69,7 @@ Sleep 2s

Type "a"
Sleep 2s
Require "Describe"
Type "D"
Sleep 2s
Type "i-"
Expand Down
5 changes: 5 additions & 0 deletions docs/tapes/features.tape
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,33 @@ Set TypingSpeed 0.05
Type "./claws"
Enter
Sleep 2s
Require "Services"

Type ":"
Sleep 0.5s
Type "ec2/instances"
Enter
Sleep 2s
Require "Instance ID"
Screenshot docs/images/resource-browser.png

Type "d"
Sleep 2s
Require "Detail"
Screenshot docs/images/detail-view.png
Escape
Sleep 1s

Type "a"
Sleep 1.5s
Require "Stop"
Screenshot docs/images/actions-menu.png
Escape
Sleep 1s

Type "R"
Sleep 1s
Require "Region"
Screenshot docs/images/multi-region.png
Type "/ap-northeast-1"
Sleep 1s
Expand Down
37 changes: 0 additions & 37 deletions docs/tapes/test-diff.tape

This file was deleted.

1 change: 1 addition & 0 deletions docs/tapes/theme-light.tape
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Sleep 0.5s
Type "ec2/instances"
Enter
Sleep 2s
Require "Instance ID"

Screenshot docs/images/theme-light.png

Expand Down
Loading