diff --git a/skptesting/benchmark-proxy.sh b/skptesting/benchmark-proxy.sh index 09516601b1..776843b013 100755 --- a/skptesting/benchmark-proxy.sh +++ b/skptesting/benchmark-proxy.sh @@ -1,12 +1,12 @@ #! /bin/bash +source "${GOPATH}/src/github.com/zalando/skipper/skptesting/benchmark.inc" + if [ "$1" == -help ]; then - log benchmark-proxy.sh [duration] [connections] [warmup-duration] + log "benchmark-proxy.sh [duration] [connections] [warmup-duration] [skipper-binary]" exit 0 fi -source $GOPATH/src/github.com/zalando/skipper/skptesting/benchmark.inc - check_deps trap cleanup-exit SIGINT diff --git a/skptesting/benchmark.inc b/skptesting/benchmark.inc index 4d051cb8f4..ea19e3ea82 100644 --- a/skptesting/benchmark.inc +++ b/skptesting/benchmark.inc @@ -10,10 +10,17 @@ if [ -z "$c" ]; then c=128; fi wd=$3 if [ -z "$wd" ]; then wd=3; fi +# skipper binary to use +bin=$4 +if [ -z "$bin" ] +then + go install github.com/zalando/skipper/cmd/skipper@latest + if [ $? -ne 0 ]; then exit -1; fi + bin="${GOBIN}/skipper" +fi + cwd=$GOPATH/src/github.com/zalando/skipper/skptesting cd $cwd -GO111MODULE=on go install github.com/zalando/skipper/... -if [ $? -ne 0 ]; then exit -1; fi loremHead=' @@ -71,7 +78,7 @@ skp() { tokeninfo_url=http://localhost:9999 fi - skipper -access-log-disabled -address "$1" -routes-file "$cwd"/"$2" -insecure \ + $bin -access-log-disabled -address "$1" -routes-file "$cwd"/"$2" -insecure \ -support-listener :0 \ -oauth2-tokeninfo-url "$tokeninfo_url" \ -idle-conns-num "$c" -close-idle-conns-period=3s \