-
Notifications
You must be signed in to change notification settings - Fork 2.7k
allow skipping providers in test_providers.sh #6778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,10 @@ | |
| # Usage: | ||
| # ./test_providers.sh # Normal mode (direct tool calls) | ||
| # ./test_providers.sh --code-exec # Code execution mode (JS batching) | ||
| # | ||
| # Environment variables: | ||
| # SKIP_PROVIDERS Comma-separated list of providers to skip (e.g., "tetrate,xai") | ||
| # SKIP_BUILD Skip the cargo build step if set | ||
|
|
||
| CODE_EXEC_MODE=false | ||
| for arg in "$@"; do | ||
|
|
@@ -91,13 +95,37 @@ is_allowed_failure() { | |
| return 1 | ||
| } | ||
|
|
||
| should_skip_provider() { | ||
| local provider="$1" | ||
| if [ -z "$SKIP_PROVIDERS" ]; then | ||
| return 1 | ||
| fi | ||
| IFS=',' read -ra SKIP_LIST <<< "$SKIP_PROVIDERS" | ||
| for skip in "${SKIP_LIST[@]}"; do | ||
| # Trim whitespace | ||
| skip=$(echo "$skip" | xargs) | ||
| if [ "$skip" = "$provider" ]; then | ||
| return 0 | ||
| fi | ||
| done | ||
| return 1 | ||
| } | ||
|
|
||
| RESULTS=() | ||
| HARD_FAILURES=() | ||
|
|
||
| for provider_config in "${PROVIDERS[@]}"; do | ||
| # Split on " -> " to get provider and models | ||
| PROVIDER="${provider_config%% -> *}" | ||
| MODELS_STR="${provider_config#* -> }" | ||
|
|
||
| # Skip provider if it's in SKIP_PROVIDERS | ||
| if should_skip_provider "$PROVIDER"; then | ||
| echo "⊘ Skipping provider: ${PROVIDER} (SKIP_PROVIDERS)" | ||
| echo "---" | ||
| continue | ||
| fi | ||
|
Comment on lines
+122
to
+127
|
||
|
|
||
| # Split models on "|" | ||
| IFS='|' read -ra MODELS <<< "$MODELS_STR" | ||
| for MODEL in "${MODELS[@]}"; do | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should_skip_providerpopulatesSKIP_LISTas a global array, which can unintentionally leak state outside the function; declare it as a local array (e.g.,local -a ...) to keep the function side-effect free.