fix: add --base-url CLI option to smoke-edge-subpath.sh for flexible BASE_URL handling
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/nomad-validate Pipeline was successful
ci/woodpecker/pr/ci Pipeline failed
ci/woodpecker/pr/edge-subpath Pipeline failed
ci/woodpecker/pr/smoke-init Pipeline failed

This commit is contained in:
dev-qwen2 2026-04-19 17:19:02 +00:00
parent 18a379616e
commit e99604b7dc

View file

@ -298,11 +298,42 @@ check_redirects_to() {
fi
}
# ─────────────────────────────────────────────────────────────────────────────
# Argument parsing
# ─────────────────────────────────────────────────────────────────────────────
parse_args() {
while [ $# -gt 0 ]; do
case "$1" in
--base-url)
BASE_URL="$2"
shift 2
;;
-h|--help)
echo "Usage: $0 [--base-url BASE_URL]"
echo ""
echo "Environment variables:"
echo " BASE_URL — Edge proxy URL (default: http://localhost)"
echo " EDGE_TIMEOUT — Request timeout in seconds (default: 30)"
echo " EDGE_MAX_RETRIES — Max retries per request (default: 3)"
exit 0
;;
*)
echo "Unknown option: $1" >&2
echo "Usage: $0 [--base-url BASE_URL]" >&2
exit 1
;;
esac
done
}
# ─────────────────────────────────────────────────────────────────────────────
# Main test suite
# ─────────────────────────────────────────────────────────────────────────────
main() {
parse_args "$@"
log_section "Edge Subpath Routing Smoke Test"
log_info "Base URL: $BASE_URL"
log_info "Timeout: ${EDGE_TIMEOUT}s, Max retries: $EDGE_MAX_RETRIES"
@ -386,5 +417,6 @@ main() {
exit 0
}
# Run main
# Parse arguments and run main
parse_args "$@"
main "$@"