From 3bb19dbc670acab3e933ea5f09379c81e4a0d9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandor=20Sz=C3=BCcs?= Date: Wed, 17 Jan 2024 16:46:57 +0100 Subject: [PATCH] feature: choose benchmark binary to test local modifications (#2872) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sandor Szücs --- skptesting/benchmark-proxy.sh | 6 +++--- skptesting/benchmark.inc | 13 ++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) 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 \