1515 can_rollout_experiment /1 ,
1616 untracked_variation_for_experiment_rollout_is_not_in_experiment /1 ,
1717 missing_kind_is_not_in_experiment /1 ,
18- experiment_rollouts_do_not_use_bucket_by /1
18+ experiment_rollouts_do_not_use_bucket_by /1 ,
19+ missing_bucket_bucket_by_does_not_error /1 ,
20+ bucket_by_null_attribute_does_not_error /1
1921]).
2022
2123% %====================================================================
@@ -28,7 +30,9 @@ all() ->
2830 can_rollout_experiment ,
2931 untracked_variation_for_experiment_rollout_is_not_in_experiment ,
3032 missing_kind_is_not_in_experiment ,
31- experiment_rollouts_do_not_use_bucket_by
33+ experiment_rollouts_do_not_use_bucket_by ,
34+ missing_bucket_bucket_by_does_not_error ,
35+ bucket_by_null_attribute_does_not_error
3236 ].
3337
3438init_per_suite (Config ) ->
@@ -116,3 +120,61 @@ experiment_rollouts_do_not_use_bucket_by(_) ->
116120 }),
117121 #{key => <<" flagKey" >>, salt => <<" flagSalt" >>},
118122 ldclient_context :set (<<" decoy" >>, <<" valueZZZ" >>, ldclient_context :new (<<" org-key" >>, <<" org" >>))).
123+
124+ missing_bucket_bucket_by_does_not_error_with_seed (_ ) ->
125+ {0 , false } = ldclient_rollout :rollout_context (
126+ ldclient_rollout :new (#{
127+ <<" kind" >> => <<" rollout" >>,
128+ <<" contextKind" >> => <<" user" >>,
129+ <<" bucketBy" >> => <<" missing" >>,
130+ <<" seed" >> => 1234567890 ,
131+ <<" variations" >> => [
132+ #{<<" variation" >> => 0 , <<" weight" >> => 50000 , <<" untracked" >> => false },
133+ #{<<" variation" >> => 1 , <<" weight" >> => 50000 , <<" untracked" >> => false }
134+ ]
135+ }),
136+ #{key => <<" flagKey" >>, salt => <<" flagSalt" >>},
137+ ldclient_context :new (<<" user-key" >>)).
138+
139+ bucket_by_null_attribute_does_not_error_with_seed (_ ) ->
140+ {0 , false } = ldclient_rollout :rollout_context (
141+ ldclient_rollout :new (#{
142+ <<" kind" >> => <<" rollout" >>,
143+ <<" contextKind" >> => <<" user" >>,
144+ <<" bucketBy" >> => <<" null" >>,
145+ <<" seed" >> => 1234567890 ,
146+ <<" variations" >> => [
147+ #{<<" variation" >> => 0 , <<" weight" >> => 50000 , <<" untracked" >> => false },
148+ #{<<" variation" >> => 1 , <<" weight" >> => 50000 , <<" untracked" >> => false }
149+ ]
150+ }),
151+ #{key => <<" flagKey" >>, salt => <<" flagSalt" >>},
152+ ldclient_context :set (<<" null" >>, null , ldclient_context :new (<<" user-key" >>))).
153+
154+ missing_bucket_bucket_by_does_not_error_without_seed (_ ) ->
155+ {0 , false } = ldclient_rollout :rollout_context (
156+ ldclient_rollout :new (#{
157+ <<" kind" >> => <<" rollout" >>,
158+ <<" contextKind" >> => <<" user" >>,
159+ <<" bucketBy" >> => <<" missing" >>,
160+ <<" variations" >> => [
161+ #{<<" variation" >> => 0 , <<" weight" >> => 50000 , <<" untracked" >> => false },
162+ #{<<" variation" >> => 1 , <<" weight" >> => 50000 , <<" untracked" >> => false }
163+ ]
164+ }),
165+ #{key => <<" flagKey" >>, salt => <<" flagSalt" >>},
166+ ldclient_context :new (<<" user-key" >>)).
167+
168+ bucket_by_null_attribute_does_not_error_without_seed (_ ) ->
169+ {0 , false } = ldclient_rollout :rollout_context (
170+ ldclient_rollout :new (#{
171+ <<" kind" >> => <<" rollout" >>,
172+ <<" contextKind" >> => <<" user" >>,
173+ <<" bucketBy" >> => <<" null" >>,
174+ <<" variations" >> => [
175+ #{<<" variation" >> => 0 , <<" weight" >> => 50000 , <<" untracked" >> => false },
176+ #{<<" variation" >> => 1 , <<" weight" >> => 50000 , <<" untracked" >> => false }
177+ ]
178+ }),
179+ #{key => <<" flagKey" >>, salt => <<" flagSalt" >>},
180+ ldclient_context :set (<<" null" >>, null , ldclient_context :new (<<" user-key" >>))).
0 commit comments