-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: decision service for group and multiple experiments. #322
Changes from all commits
3992620
62987b0
3655fc6
10431d2
8d69a02
f4c9e7e
5ef8e26
cd59fa8
569720a
8fb6b73
777e975
c2d6752
790ee40
bad76e7
804fdb6
f0d9f60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,6 +196,78 @@ def setUp(self, config_dict='config_dict'): | |
}, | ||
], | ||
}, | ||
{ | ||
'key': 'test_experiment3', | ||
'status': 'Running', | ||
'layerId': '6', | ||
"audienceConditions": [ | ||
"or", | ||
"11160" | ||
], | ||
'audienceIds': ['11160'], | ||
'id': '111134', | ||
'forcedVariations': {}, | ||
'trafficAllocation': [ | ||
{'entityId': '222239', 'endOfRange': 2500}, | ||
{'entityId': '', 'endOfRange': 5000}, | ||
{'entityId': '', 'endOfRange': 7500}, | ||
{'entityId': '', 'endOfRange': 10000} | ||
], | ||
'variations': [ | ||
{ | ||
'id': '222239', | ||
'key': 'control', | ||
'variables': [], | ||
} | ||
], | ||
}, | ||
{ | ||
'key': 'test_experiment4', | ||
'status': 'Running', | ||
'layerId': '7', | ||
"audienceConditions": [ | ||
"or", | ||
"11160" | ||
], | ||
'audienceIds': ['11160'], | ||
'id': '111135', | ||
'forcedVariations': {}, | ||
'trafficAllocation': [ | ||
{'entityId': '222240', 'endOfRange': 5000}, | ||
{'entityId': '', 'endOfRange': 7500}, | ||
{'entityId': '', 'endOfRange': 10000} | ||
], | ||
'variations': [ | ||
{ | ||
'id': '222240', | ||
'key': 'control', | ||
'variables': [], | ||
} | ||
], | ||
}, | ||
{ | ||
'key': 'test_experiment5', | ||
'status': 'Running', | ||
'layerId': '8', | ||
"audienceConditions": [ | ||
"or", | ||
"11160" | ||
], | ||
'audienceIds': ['11160'], | ||
'id': '111136', | ||
'forcedVariations': {}, | ||
'trafficAllocation': [ | ||
{'entityId': '222241', 'endOfRange': 7500}, | ||
{'entityId': '', 'endOfRange': 10000} | ||
], | ||
'variations': [ | ||
{ | ||
'id': '222241', | ||
'key': 'control', | ||
'variables': [], | ||
} | ||
], | ||
}, | ||
], | ||
'groups': [ | ||
{ | ||
|
@@ -239,6 +311,72 @@ def setUp(self, config_dict='config_dict'): | |
{'entityId': '32222', "endOfRange": 3000}, | ||
{'entityId': '32223', 'endOfRange': 7500}, | ||
], | ||
}, | ||
{ | ||
'id': '19229', | ||
'policy': 'random', | ||
'experiments': [ | ||
{ | ||
'id': '42222', | ||
'key': 'group_2_exp_1', | ||
'status': 'Running', | ||
"audienceConditions": [ | ||
"or", | ||
"11160" | ||
], | ||
'audienceIds': ['11160'], | ||
'layerId': '211183', | ||
'variations': [ | ||
{'key': 'var_1', 'id': '38901'}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. append experiment key name with the key. |
||
], | ||
'forcedVariations': {}, | ||
'trafficAllocation': [ | ||
{'entityId': '38901', 'endOfRange': 10000} | ||
], | ||
}, | ||
{ | ||
'id': '42223', | ||
'key': 'group_2_exp_2', | ||
'status': 'Running', | ||
"audienceConditions": [ | ||
"or", | ||
"11160" | ||
], | ||
'audienceIds': ['11160'], | ||
'layerId': '211184', | ||
'variations': [ | ||
{'key': 'var_1', 'id': '38905'} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here. |
||
], | ||
'forcedVariations': {}, | ||
'trafficAllocation': [ | ||
{'entityId': '38905', 'endOfRange': 10000} | ||
], | ||
}, | ||
{ | ||
'id': '42224', | ||
'key': 'group_2_exp_3', | ||
'status': 'Running', | ||
"audienceConditions": [ | ||
"or", | ||
"11160" | ||
], | ||
'audienceIds': ['11160'], | ||
'layerId': '211185', | ||
'variations': [ | ||
{'key': 'var_1', 'id': '38906'} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above. |
||
], | ||
'forcedVariations': {}, | ||
'trafficAllocation': [ | ||
{'entityId': '38906', 'endOfRange': 10000} | ||
], | ||
} | ||
], | ||
'trafficAllocation': [ | ||
{'entityId': '42222', "endOfRange": 2500}, | ||
{'entityId': '42223', 'endOfRange': 5000}, | ||
{'entityId': '42224', "endOfRange": 7500}, | ||
{'entityId': '', 'endOfRange': 10000}, | ||
], | ||
} | ||
], | ||
'attributes': [{'key': 'test_attribute', 'id': '111094'}], | ||
|
@@ -255,6 +393,12 @@ def setUp(self, config_dict='config_dict'): | |
'{"name": "test_attribute", "type": "custom_attribute", "value": "test_value_2"}]]]', | ||
'id': '11159', | ||
}, | ||
{ | ||
'name': 'Test attribute users 3', | ||
'conditions': "[\"and\", [\"or\", [\"or\", {\"match\": \"exact\", \"name\": \ | ||
\"experiment_attr\", \"type\": \"custom_attribute\", \"value\": \"group_experiment\"}]]]", | ||
'id': '11160', | ||
} | ||
], | ||
'rollouts': [ | ||
{'id': '201111', 'experiments': []}, | ||
|
@@ -364,6 +508,20 @@ def setUp(self, config_dict='config_dict'): | |
'rolloutId': '211111', | ||
'variables': [], | ||
}, | ||
{ | ||
'id': '91115', | ||
'key': 'test_feature_in_exclusion_group', | ||
'experimentIds': ['42222', '42223', '42224'], | ||
'rolloutId': '211111', | ||
'variables': [], | ||
}, | ||
{ | ||
'id': '91116', | ||
'key': 'test_feature_in_multiple_experiments', | ||
'experimentIds': ['111134', '111135', '111136'], | ||
'rolloutId': '211111', | ||
'variables': [], | ||
}, | ||
], | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -501,7 +501,7 @@ def test_init__with_v4_datafile(self): | |
'211111', | ||
{'number_of_projects': entities.Variable('131', 'number_of_projects', 'integer', '10')}, | ||
), | ||
'test_feature_in_group': entities.FeatureFlag('91113', 'test_feature_in_group', ['32222'], '', {}, '19228'), | ||
'test_feature_in_group': entities.FeatureFlag('91113', 'test_feature_in_group', ['32222'], '', {}), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why |
||
} | ||
|
||
expected_rollout_id_map = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to discuss offline.