This commit is contained in:
Michael Neale
2025-10-01 18:10:55 +10:00
parent fc0d3589dc
commit 8d05348975
3 changed files with 32 additions and 123 deletions
+32 -10
View File
@@ -88,17 +88,39 @@ jobs:
- name: Make Binary Executable
run: chmod +x target/release/goose
- name: Debug - Check binary and environment
run: |
ls -la target/release/goose
./target/release/goose --version
echo "Provider: ${{ matrix.provider }}"
echo "ANTHROPIC_API_KEY set: ${{ secrets.ANTHROPIC_API_KEY != '' }}"
echo "OPENAI_API_KEY set: ${{ secrets.OPENAI_API_KEY != '' }}"
- name: Run Smoke Test
env:
GOOSE_PROVIDER: ${{ matrix.provider }}
GOOSE_MODEL: ${{ matrix.provider == 'anthropic' && 'claude-sonnet-4-5-20250929' || 'gpt-5' }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
PROVIDERS: ${{ matrix.provider }}
run: ./tests/smoke/run_smoke_tests.sh
HOME: /tmp/goose-home
GOOSE_DISABLE_KEYRING: 1
run: |
# Ensure the HOME directory structure exists
mkdir -p $HOME/.local/share/goose/sessions
mkdir -p $HOME/.config/goose
# Create test file in current directory
echo "hello" > hello.txt
echo "=== Goose Smoke Test ==="
echo "Provider: ${GOOSE_PROVIDER}"
echo "Model: ${GOOSE_MODEL}"
echo ""
# Run goose and capture output
OUTPUT=$(./target/release/goose run --text "please list files in the current directory" --with-builtin developer 2>&1)
echo "Output:"
echo "$OUTPUT"
echo ""
# Check if hello.txt appears in output
if echo "$OUTPUT" | grep -q "hello.txt"; then
echo "✓ SUCCESS: Test passed - found hello.txt in output"
exit 0
else
echo "✗ FAILED: Test failed - hello.txt not found in output"
exit 1
fi
-40
View File
@@ -1,40 +0,0 @@
# Goose Smoke Tests
Simple smoke test for the goose binary with multiple providers.
## Quick Start
```bash
# Set API keys
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."
# Build binary
cargo build --release
# Run tests
./tests/smoke/run_smoke_tests.sh
```
## What It Tests
Creates a `hello.txt` file in a temp directory, runs goose with `--with-builtin developer`, asks it to "list files", and verifies the output contains "hello.txt".
Tests that:
- The binary runs with API keys from environment variables
- The developer extension loads via `--with-builtin developer`
- Basic tool usage (shell) works
## Options
```bash
# Test specific provider
PROVIDERS="anthropic" ./tests/smoke/run_smoke_tests.sh
# Verbose output
VERBOSE=1 ./tests/smoke/run_smoke_tests.sh
```
## CI
Add GitHub secrets `ANTHROPIC_API_KEY` and `OPENAI_API_KEY`. Workflow runs automatically on push/PR.
-73
View File
@@ -1,73 +0,0 @@
#!/usr/bin/env bash
set -e
set -u
echo "=== Goose Smoke Test ==="
# Find the goose binary
if [ -f "target/release/goose" ]; then
GOOSE_BINARY="./target/release/goose"
else
echo "ERROR: goose binary not found at target/release/goose"
exit 1
fi
# Check API keys based on provider
PROVIDER="${PROVIDERS:-anthropic}"
if [ "$PROVIDER" = "anthropic" ]; then
if [ -z "${ANTHROPIC_API_KEY:-}" ]; then
echo "ERROR: ANTHROPIC_API_KEY not set"
exit 1
fi
MODEL="claude-sonnet-4-5-20250929"
elif [ "$PROVIDER" = "openai" ]; then
if [ -z "${OPENAI_API_KEY:-}" ]; then
echo "ERROR: OPENAI_API_KEY not set"
exit 1
fi
MODEL="gpt-5"
else
echo "ERROR: Unknown provider: $PROVIDER"
exit 1
fi
# Setup isolated test environment
TEST_DIR=$(mktemp -d -t goose-smoke.XXXXXX)
trap "rm -rf $TEST_DIR" EXIT
export HOME="$TEST_DIR"
export GOOSE_DISABLE_KEYRING=1
export GOOSE_PROVIDER="$PROVIDER"
export GOOSE_MODEL="$MODEL"
# Create required directories
mkdir -p "$HOME/.local/share/goose/sessions"
mkdir -p "$HOME/.config/goose"
# Create test file
echo "hello" > "$TEST_DIR/hello.txt"
echo "Provider: $PROVIDER"
echo "Model: $MODEL"
echo "Binary: $GOOSE_BINARY"
echo "Test dir: $TEST_DIR"
echo ""
# Run the test
cd "$TEST_DIR"
echo "Running: $GOOSE_BINARY run --text 'please list files in dir $TEST_DIR' --with-builtin developer"
OUTPUT=$($GOOSE_BINARY run --text "please list files in dir $TEST_DIR" --with-builtin developer 2>&1)
echo "Output:"
echo "$OUTPUT"
echo ""
# Check if hello.txt appears in output
if echo "$OUTPUT" | grep -q "hello.txt"; then
echo "✓ SUCCESS: Test passed - found hello.txt in output"
exit 0
else
echo "✗ FAILED: Test failed - hello.txt not found in output"
exit 1
fi