mirror of
https://github.com/block/goose.git
synced 2026-04-28 03:29:36 +00:00
Some checks failed
Canary / Prepare Version (push) Waiting to run
Canary / build-cli (push) Blocked by required conditions
Canary / Upload Install Script (push) Blocked by required conditions
Canary / bundle-desktop (push) Blocked by required conditions
Canary / bundle-desktop-linux (push) Blocked by required conditions
Canary / bundle-desktop-windows (push) Blocked by required conditions
Canary / Release (push) Blocked by required conditions
Cargo Deny / deny (push) Waiting to run
CI / changes (push) Waiting to run
CI / Check Rust Code Format (push) Blocked by required conditions
CI / Build and Test Rust Project (push) Blocked by required conditions
CI / Lint Rust Code (push) Blocked by required conditions
CI / Check OpenAPI Schema is Up-to-Date (push) Blocked by required conditions
CI / Test and Lint Electron Desktop App (push) Blocked by required conditions
Live Provider Tests / check-fork (push) Waiting to run
Live Provider Tests / changes (push) Blocked by required conditions
Live Provider Tests / Build Binary (push) Blocked by required conditions
Live Provider Tests / Smoke Tests (push) Blocked by required conditions
Live Provider Tests / Smoke Tests (Code Execution) (push) Blocked by required conditions
Live Provider Tests / Compaction Tests (push) Blocked by required conditions
Publish Docker Image / docker (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy Documentation / deploy (push) Has been cancelled
Publish Ask AI Bot Docker Image / docker (push) Has been cancelled
57 lines
1.7 KiB
Bash
Executable file
57 lines
1.7 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
LIB_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
source "$LIB_DIR/test_providers_lib.sh"
|
|
|
|
echo "Mode: normal (direct tool calls)"
|
|
echo ""
|
|
|
|
GOOSE_BIN=$(build_goose)
|
|
BUILTINS="developer"
|
|
|
|
mkdir -p target
|
|
TEST_CONTENT="test-content-abc123"
|
|
TEST_FILE="./target/test-content.txt"
|
|
echo "$TEST_CONTENT" > "$TEST_FILE"
|
|
|
|
run_test() {
|
|
local provider="$1" model="$2" result_file="$3" output_file="$4"
|
|
local testdir=$(mktemp -d)
|
|
|
|
local prompt
|
|
if is_agentic_provider "$provider"; then
|
|
cp "$TEST_FILE" "$testdir/test-content.txt"
|
|
prompt="read ./test-content.txt and output its contents exactly"
|
|
else
|
|
echo "$TEST_CONTENT" > "$testdir/input.txt"
|
|
prompt="Use the text_editor view command to read ./input.txt, then output this file's contents in UPPERCASE. Do NOT use any other tool in Developer"
|
|
fi
|
|
|
|
(
|
|
export GOOSE_PROVIDER="$provider"
|
|
export GOOSE_MODEL="$model"
|
|
cd "$testdir" && "$GOOSE_BIN" run --text "$prompt" --with-builtin "$BUILTINS" 2>&1
|
|
) > "$output_file" 2>&1
|
|
|
|
if is_agentic_provider "$provider"; then
|
|
if grep -qi "$TEST_CONTENT" "$output_file"; then
|
|
echo "success|test content found by model" > "$result_file"
|
|
else
|
|
echo "failure|test content not found by model" > "$result_file"
|
|
fi
|
|
else
|
|
if ! grep -qE "(text_editor \| developer)|(▸.*text_editor.*developer)" "$output_file"; then
|
|
echo "failure|model did not use text_editor tool" > "$result_file"
|
|
elif ! grep -q "TEST-CONTENT-ABC123" "$output_file"; then
|
|
echo "failure|model did not return uppercased file content" > "$result_file"
|
|
else
|
|
echo "success|model read and uppercased file content" > "$result_file"
|
|
fi
|
|
fi
|
|
|
|
rm -rf "$testdir"
|
|
}
|
|
|
|
build_test_cases
|
|
run_test_cases run_test
|
|
report_results
|