Files
1jehuang--jcode/scripts/test_auth_e2e.sh
T
wehub-resource-sync a789495a98
FreeBSD Smoke / FreeBSD Smoke (x86_64) (push) Has been cancelled
CI / Quality Guardrails (push) Has been cancelled
CI / Build & Test (macos-latest) (push) Has been cancelled
CI / Build & Test (ubuntu-latest) (push) Has been cancelled
CI / Build & Test (windows-latest) (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / PowerShell Syntax (push) Has been cancelled
CI / Windows Cross-Target Check (Linux) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:10:34 +08:00

35 lines
774 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
repo_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
provider=${JCODE_PROVIDER:-auto}
prompt=${JCODE_AUTH_TEST_PROMPT:-"Reply with exactly AUTH_TEST_OK and nothing else. Do not call tools."}
echo "=== Auth E2E Test ==="
echo "Provider: ${provider}"
args=(auth-test --prompt "$prompt")
if [[ "${provider}" != "auto" ]]; then
args=(--provider "$provider" "${args[@]}")
else
args+=(--all-configured)
fi
if [[ "${JCODE_AUTH_TEST_LOGIN:-0}" == "1" ]]; then
args+=(--login)
fi
if [[ "${JCODE_AUTH_TEST_NO_SMOKE:-0}" == "1" ]]; then
args+=(--no-smoke)
fi
if [[ "${JCODE_AUTH_TEST_JSON:-0}" == "1" ]]; then
args+=(--json)
fi
(cd "$repo_root" && cargo run --bin jcode -- "${args[@]}")
echo ""
echo "=== Auth E2E OK ==="