update
Some checks failed
Docker Build and Push / build-and-push (push) Failing after 24s
Tests / test (bash) (push) Successful in 10s
Tests / test (zsh) (push) Successful in 10s
Tests / lint (push) Successful in 9s
Tests / docker (push) Successful in 19s

This commit is contained in:
mike
2025-12-11 08:27:03 +01:00
parent 3f9acb08ec
commit 074a2b1f5f
5 changed files with 169 additions and 53 deletions

View File

@@ -16,6 +16,28 @@ assert_nonempty() {
assert_contains() {
if [[ ! "$1" =~ $2 ]]; then fail "$3"; fi
}
# Ensure output does not contain any of the common error phrases.
assert_no_common_errors() {
local output="$1"
local -a patterns=(
"ACSH_ACTIVE_API_KEY not set"
"Bad Request"
"Unauthorized"
"Too Many Requests"
"Internal Server Error"
"Unknown Error"
"Failed to parse completions"
"SyntaxError"
"ERROR:"
)
for pat in "${patterns[@]}"; do
if grep -qE "$pat" <<<"$output"; then
printf "Test failed: output contains error pattern '%s'\nFull output follows:\n%s\n" "$pat" "$output"
exit 1
fi
done
}
# --------------------------------
echo "=== SETUP ==="
@@ -50,6 +72,7 @@ pass "finish config contains lmstudio"
out=$(finish command "ls # show largest files" 2>&1) ; code=$?
assert_ok $code "finish command did not exit 0"
assert_nonempty "$out" "finish command returned empty output"
assert_no_common_errors "$out"
pass "finish command executed and returned output"
# ------------------------------- CLEANUP --------------------------------