Skip to content

Integration tests and clean up of zed and parsing #38

Integration tests and clean up of zed and parsing

Integration tests and clean up of zed and parsing #38

Workflow file for this run

name: E2E Tests
on:
push:
branches: [main]
paths:
- 'src/**'
- 'packages/**'
- 'relay-pty/**'
- 'scripts/e2e-test.sh'
- 'package.json'
- '.github/workflows/e2e-tests.yml'
pull_request:
branches: [main]
paths:
- 'src/**'
- 'packages/**'
- 'relay-pty/**'
- 'scripts/e2e-test.sh'
- 'package.json'
- '.github/workflows/e2e-tests.yml'
# Allow manual trigger for on-demand testing
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
e2e-test:
name: E2E Integration Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node-version: [20]
fail-fast: false
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: relay-pty
- name: Install dependencies
run: npm ci
- name: Ensure rollup optional dependencies are installed
run: npm install --no-save rollup || true
- name: Build project
run: npm run build
- name: Link CLI for local testing
run: npm link
- name: Verify CLI is available
run: agent-relay --version
- name: Cache Claude CLI
id: cache-claude
uses: actions/cache@v4
with:
path: ~/.npm-global
key: claude-cli-${{ runner.os }}-${{ hashFiles('.github/workflows/e2e-tests.yml') }}
- name: Install Claude CLI
if: steps.cache-claude.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
npm install -g @anthropic-ai/claude-code
- name: Add Claude CLI to PATH
run: |
echo "$HOME/.npm-global/bin" >> $GITHUB_PATH
export PATH="$HOME/.npm-global/bin:$PATH"
claude --version || echo "Claude CLI ready"
- name: Download dashboard binary
run: |
# Determine platform and architecture
if [ "${{ runner.os }}" = "Linux" ]; then
BINARY_NAME="relay-dashboard-server-linux-x64"
elif [ "${{ runner.os }}" = "macOS" ]; then
# Check architecture
if [ "$(uname -m)" = "arm64" ]; then
BINARY_NAME="relay-dashboard-server-darwin-arm64"
else
BINARY_NAME="relay-dashboard-server-darwin-x64"
fi
else
echo "Unsupported OS: ${{ runner.os }}"
exit 1
fi
echo "Downloading dashboard binary: $BINARY_NAME"
# Get latest release from relay-dashboard repo
RELEASE_URL="https://github.com/AgentWorkforce/relay-dashboard/releases/latest/download/${BINARY_NAME}.gz"
echo "URL: $RELEASE_URL"
# Install to user local bin (no sudo required)
mkdir -p ~/.local/bin
curl -fsSL "$RELEASE_URL" | gunzip > ~/.local/bin/relay-dashboard-server
chmod +x ~/.local/bin/relay-dashboard-server
# Add to PATH for this workflow
echo "$HOME/.local/bin" >> $GITHUB_PATH
# Verify
echo "Installed dashboard binary:"
~/.local/bin/relay-dashboard-server --version || echo "Binary installed (version check may not be supported)"
- name: Check for API key
id: check-key
run: |
if [ -n "$ANTHROPIC_API_KEY" ]; then
echo "has_key=true" >> $GITHUB_OUTPUT
else
echo "has_key=false" >> $GITHUB_OUTPUT
echo "::warning::ANTHROPIC_API_KEY not set - Claude spawn test will be skipped"
fi
- name: Run E2E test
id: e2e-test
if: steps.check-key.outputs.has_key == 'true'
timeout-minutes: 5
run: ./scripts/e2e-test.sh --port 3888
- name: Run daemon-only test (no API key)
if: steps.check-key.outputs.has_key == 'false'
timeout-minutes: 2
run: ./scripts/e2e-test.sh --daemon-only --port 3888
- name: Test Summary
if: always()
run: |
echo "## E2E Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **OS:** ${{ matrix.os }}" >> $GITHUB_STEP_SUMMARY
echo "- **Node:** ${{ matrix.node-version }}" >> $GITHUB_STEP_SUMMARY
echo "- **API Key Present:** ${{ steps.check-key.outputs.has_key }}" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.e2e-test.outcome }}" == "success" ]; then
echo "- **Status:** Passed" >> $GITHUB_STEP_SUMMARY
elif [ "${{ steps.e2e-test.outcome }}" == "skipped" ]; then
echo "- **Status:** Skipped (no API key)" >> $GITHUB_STEP_SUMMARY
else
echo "- **Status:** Failed" >> $GITHUB_STEP_SUMMARY
fi