mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
make provider, model, api key for testing configurable
This commit is contained in:
@@ -14,7 +14,7 @@ The script self-activates hermit for `pnpm`/`node`, but needs `ANTHROPIC_API_KEY
|
||||
|
||||
```bash
|
||||
TEST_SESSION_NAME=$(date +"%y%m%d-%H%M%S")
|
||||
screen -dmS $TEST_SESSION_NAME bash -c "source ~/.zshrc 2>/dev/null; bash ui/desktop/tests/e2e-tests/scripts/e2e-start.sh $TEST_SESSION_NAME"
|
||||
screen -dmS $TEST_SESSION_NAME bash -c "bash ui/desktop/tests/e2e-tests/scripts/e2e-start.sh $TEST_SESSION_NAME"
|
||||
```
|
||||
|
||||
Then wait for the port file and verify the app is listening:
|
||||
@@ -40,7 +40,7 @@ screen -r $TEST_SESSION_NAME # attach to see errors (Ctrl-A D to detach)
|
||||
```
|
||||
|
||||
Common startup failures:
|
||||
- `ANTHROPIC_API_KEY must be set` — key not in environment; ensure `~/.zshrc` exports it
|
||||
- `ANTHROPIC_API_KEY must be set` — create `~/.config/goose/e2e.env` with your provider config (see e2e-start.sh)
|
||||
- `pnpm: not found` — hermit activation failed; the script does this automatically now
|
||||
- Screen session dies immediately — check `screen -ls`; if no session, run the script directly to see errors
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ jobs:
|
||||
with:
|
||||
name: e2e-test-results
|
||||
path: ui/desktop/tests/e2e-tests/results/
|
||||
retention-days: 7
|
||||
retention-days: 1
|
||||
|
||||
smoke-tests:
|
||||
name: Smoke Tests
|
||||
|
||||
@@ -61,14 +61,32 @@ echo ""
|
||||
# Clean up lock file when Electron exits
|
||||
trap 'rm -f "$BASE_DIR/.port-locks/$CDP_PORT"' EXIT
|
||||
|
||||
# Load local e2e config (CI sets env vars directly and doesn't need this file).
|
||||
# Create ~/.config/goose/e2e.env for local dev with your provider config, e.g.:
|
||||
# GOOSE_PROVIDER=anthropic
|
||||
# GOOSE_MODEL=claude-haiku-4-5-20251001
|
||||
# ANTHROPIC_API_KEY=sk-ant-...
|
||||
E2E_ENV="${HOME}/.config/goose/e2e.env"
|
||||
if [[ -f "$E2E_ENV" ]]; then
|
||||
# Warn if the file is readable by others (it contains secrets)
|
||||
if [[ "$(stat -f %Lp "$E2E_ENV" 2>/dev/null)" != "600" ]]; then
|
||||
echo "Warning: $E2E_ENV should be chmod 600 (currently $(stat -f %Lp "$E2E_ENV"))"
|
||||
fi
|
||||
echo "Loading e2e config from $E2E_ENV"
|
||||
set -a
|
||||
source "$E2E_ENV"
|
||||
set +a
|
||||
fi
|
||||
|
||||
# Start the app in foreground (Ctrl+C to stop)
|
||||
export GOOSE_ALLOWLIST_BYPASS=true
|
||||
export GOOSE_DISABLE_KEYRING=1
|
||||
export GOOSE_PATH_ROOT="$SESSION_DIR/root"
|
||||
export GOOSE_WORKING_DIR="$SESSION_DIR/workspace"
|
||||
export GOOSE_PROVIDER=anthropic
|
||||
export GOOSE_MODEL=claude-haiku-4-5-20251001
|
||||
export ANTHROPIC_API_KEY="${ANTHROPIC_API_KEY:?ANTHROPIC_API_KEY must be set}"
|
||||
export GOOSE_PROVIDER="${GOOSE_PROVIDER:-anthropic}"
|
||||
export GOOSE_MODEL="${GOOSE_MODEL:-claude-haiku-4-5-20251001}"
|
||||
# API key is provider-specific (e.g. ANTHROPIC_API_KEY, OPENAI_API_KEY).
|
||||
# Set it in ~/.config/goose/e2e.env for local dev, or via env vars in CI.
|
||||
export GOOSE_TELEMETRY_ENABLED=false
|
||||
export ENABLE_PLAYWRIGHT=true
|
||||
export PLAYWRIGHT_DEBUG_PORT="$CDP_PORT"
|
||||
|
||||
Reference in New Issue
Block a user