forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.sh
executable file
·45 lines (39 loc) · 856 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/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 "$@"