File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,8 +26,7 @@ if [ -z "${arrivalRate}" ]; then
2626 exit 1
2727fi
2828
29- if ! [[ " ${environment} " =~ ^(dev| ref)$ ]]
30- then
29+ if ! [[ " ${environment} " =~ ^(dev| ref)$ ]]; then
3130 echo " environment must be dev or ref"
3231 exit 1
3332fi
@@ -40,11 +39,18 @@ export vpc_subnets
4039artillery_worker_role_name=$( aws cloudformation list-exports --output json | jq -r ' .Exports[] | select(.Name == "artillery-resources:ArtilleryWorkerRoleName") | .Value' | grep -o ' [^:]*$' )
4140export artillery_worker_role_name
4241
42+ if [ -z " ${artillery_key} " ]; then
43+ echo " artillery_key is unset. Running without --record to Artillery Cloud."
44+ RECORD_ARGS=" "
45+ else
46+ RECORD_ARGS=" --record --key ${artillery_key} "
47+ fi
48+
4349cat << EOF > runtimeenv.env
44- maxVusers=$maxVusers
45- duration=$duration
46- arrivalRate=$arrivalRate
47- rampUpDuration=$rampUpDuration
50+ maxVusers=${ maxVusers}
51+ duration=${ duration}
52+ arrivalRate=${ arrivalRate}
53+ rampUpDuration=${ rampUpDuration}
4854EOF
4955
5056echo ${launch_config}
@@ -60,6 +66,7 @@ npx artillery run-fargate \
6066 --task-role-name " ${artillery_worker_role_name} " \
6167 --env-file runtimeenv.env \
6268 --output notify_load_test.json \
69+ $RECORD_ARGS \
6370 artillery/notify_load_test.yml
6471
65- npx artillery report notify_load_test.json
72+ npx artillery report notify_load_test.json
You can’t perform that action at this time.
0 commit comments