Commit 361ac342 authored by Grant Young's avatar Grant Young

Hotfix guard when Environment config is missing

parent 0285fb41
......@@ -30,7 +30,8 @@ export function getRpsThresholds(modifier=1.0, endpoints=1) {
}
export function getTtfbThreshold(ttfbBase=__ENV.TTFB_THRESHOLD) {
return parseInt(ttfbBase) + parseInt(__ENV.ENVIRONMENT_LATENCY);
let latency = parseInt(__ENV.ENVIRONMENT_LATENCY) || 0;
return parseInt(ttfbBase) + latency;
}
export function adjustRps(modifier=1.0) {
......
......@@ -50,8 +50,8 @@ module RunK6
env_vars['ENVIRONMENT_NAME'] = ENV['ENVIRONMENT_NAME'].dup || env_file_vars['environment']['name']
env_vars['ENVIRONMENT_URL'] = (ENV['ENVIRONMENT_URL'].dup || env_file_vars['environment']['url']).chomp('/')
env_vars['ENVIRONMENT_LATENCY'] = ENV['ENVIRONMENT_LATENCY'].dup || env_file_vars['environment']['config']['latency']
env_vars['ENVIRONMENT_REPO_STORAGE'] = ENV['ENVIRONMENT_REPO_STORAGE'].dup || env_file_vars['environment']['config']['repo_storage']
env_vars['ENVIRONMENT_LATENCY'] = ENV['ENVIRONMENT_LATENCY'].dup || env_file_vars['environment'].dig('config', 'latency')
env_vars['ENVIRONMENT_REPO_STORAGE'] = ENV['ENVIRONMENT_REPO_STORAGE'].dup || env_file_vars['environment'].dig('config', 'repo_storage')
env_vars['ENVIRONMENT_PROJECTS'] = env_file_vars['projects'].to_json
options_file_vars = JSON.parse(File.read(options_file))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment