Skip to content

Commit

Permalink
Addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rashidsp committed May 17, 2019
1 parent ec4dcfc commit 8f25a7c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
5 changes: 1 addition & 4 deletions lib/optimizely/project_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class ProjectConfig
attr_reader :feature_variable_key_map
attr_reader :group_key_map
attr_reader :rollout_id_map
attr_reader :rollout_experiment_id_map
attr_reader :rollout_experiment_key_map
attr_reader :variation_id_map
attr_reader :variation_id_to_variable_usage_map
Expand Down Expand Up @@ -121,12 +120,10 @@ def initialize(datafile, logger, error_handler)
end
end
@rollout_id_map = generate_key_map(@rollouts, 'id')
# split out the experiment id and key map for rollouts
@rollout_experiment_id_map = {}
# split out the experiment key map for rollouts
@rollout_experiment_key_map = {}
@rollout_id_map.each_value do |rollout|
exps = rollout.fetch('experiments')
@rollout_experiment_id_map = @rollout_experiment_id_map.merge(generate_key_map(exps, 'id'))
@rollout_experiment_key_map = @rollout_experiment_key_map.merge(generate_key_map(exps, 'key'))
end
@all_experiments = @experiment_key_map.merge(@rollout_experiment_key_map)
Expand Down
10 changes: 0 additions & 10 deletions spec/project_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -666,15 +666,6 @@
'166661' => config_body['rollouts'][1]
}

expected_rollout_experiment_id_map = {
'177770' => config_body['rollouts'][0]['experiments'][0],
'177772' => config_body['rollouts'][0]['experiments'][1],
'177776' => config_body['rollouts'][0]['experiments'][2],
'177774' => config_body['rollouts'][1]['experiments'][0],
'177779' => config_body['rollouts'][1]['experiments'][1],
'177780' => config_body['rollouts'][1]['experiments'][2]
}

expected_rollout_experiment_key_map = {
'177770' => config_body['rollouts'][0]['experiments'][0],
'177772' => config_body['rollouts'][0]['experiments'][1],
Expand All @@ -695,7 +686,6 @@
expect(project_config.variation_key_map).to eq(expected_variation_key_map)
expect(project_config.variation_id_to_variable_usage_map).to eq(expected_variation_id_to_variable_usage_map)
expect(project_config.rollout_id_map).to eq(expected_rollout_id_map)
expect(project_config.rollout_experiment_id_map).to eq(expected_rollout_experiment_id_map)
expect(project_config.rollout_experiment_key_map).to eq(expected_rollout_experiment_key_map)
end

Expand Down

0 comments on commit 8f25a7c

Please sign in to comment.