mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 20:24:18 -06:00
d29f73b197
* Add loadtest which authenticates with API key - Edit load tests to assign the orgId in the default function, as the setup function is only called once for all VUs and therefore the change is not persisted to each VU. - Remove side effect from orgId setup function and explicitly set orgId in setup client * sort semicolons, whitespace
46 lines
855 B
Bash
Executable File
46 lines
855 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
PWD=$(pwd)
|
|
|
|
run() {
|
|
duration='15m'
|
|
url='http://localhost:3000'
|
|
vus='2'
|
|
testcase='auth_token_test'
|
|
slowQuery=''
|
|
out=''
|
|
apiKey=''
|
|
|
|
while getopts ":d:u:v:c:s:o:k:" o; do
|
|
case "${o}" in
|
|
d)
|
|
duration=${OPTARG}
|
|
;;
|
|
u)
|
|
url=${OPTARG}
|
|
;;
|
|
v)
|
|
vus=${OPTARG}
|
|
;;
|
|
c)
|
|
testcase=${OPTARG}
|
|
;;
|
|
s)
|
|
slowQuery=${OPTARG}
|
|
;;
|
|
o)
|
|
out=${OPTARG}
|
|
;;
|
|
k)
|
|
apiKey=${OPTARG}
|
|
;;
|
|
|
|
esac
|
|
done
|
|
shift $((OPTIND-1))
|
|
|
|
docker run -t --network=host -v $PWD:/src -e URL=$url -e SLOW_QUERY=$slowQuery -e K6_OUT=$out -e API_KEY=$apiKey --rm -i loadimpact/k6:master run --vus $vus --duration $duration src/$testcase.js
|
|
}
|
|
|
|
run "$@"
|