diff --git a/tests/acceptance/datafile.py b/tests/acceptance/datafile.py index 3b8d40d9..33c28012 100644 --- a/tests/acceptance/datafile.py +++ b/tests/acceptance/datafile.py @@ -1,115 +1,465 @@ -datafile = {'accountId': '10845721364', 'anonymizeIP': True, 'attributes': [{'id': '16921322086', 'key': 'attr_1'}], - 'audiences': [{ - 'conditions': '["and", ["or", ["or", {"match": "exact", "name": "attr_1", "type": "custom_attribute", "value": "hola"}]]]', - 'id': '16902921321', 'name': 'Audience1'}, { - 'conditions': '["or", {"match": "exact", "name": "$opt_dummy_attribute", "type": "custom_attribute", "value": "$opt_dummy_value"}]', - 'id': '$opt_dummy_audience', - 'name': 'Optimizely-Generated Audience for Backwards Compatibility'}], - 'botFiltering': False, 'environmentKey': 'production', - 'events': [{'experimentIds': ['16910084756', '16911963060'], 'id': '16911532385', 'key': 'myevent'}], - 'experiments': [ - {'audienceConditions': ['or', '16902921321'], 'audienceIds': ['16902921321'], 'forcedVariations': {}, - 'id': '16911963060', 'key': 'ab_test1', 'layerId': '16916031507', 'status': 'Running', - 'trafficAllocation': [{'endOfRange': 1000, 'entityId': '16905941566'}, - {'endOfRange': 5000, 'entityId': '16905941566'}, - {'endOfRange': 8000, 'entityId': '16905941566'}, - {'endOfRange': 9000, 'entityId': '16905941566'}, - {'endOfRange': 10000, 'entityId': '16905941566'}], - 'variations': [{'featureEnabled': True, 'id': '16905941566', 'key': 'variation_1', 'variables': []}, - {'featureEnabled': True, 'id': '16927770169', 'key': 'variation_2', 'variables': []}]}, - {'audienceConditions': ['or', '16902921321'], 'audienceIds': ['16902921321'], 'forcedVariations': {}, - 'id': '16910084756', 'key': 'feature_2_test', 'layerId': '16933431472', 'status': 'Running', - 'trafficAllocation': [{'endOfRange': 5000, 'entityId': '16925360560'}, - {'endOfRange': 10000, 'entityId': '16925360560'}], - 'variations': [{'featureEnabled': True, 'id': '16925360560', 'key': 'variation_1', 'variables': []}, - {'featureEnabled': True, 'id': '16915611472', 'key': 'variation_2', 'variables': []}]}], - 'featureFlags': [{'experimentIds': ['16911963060'], 'id': '12672', 'key': 'flag_ab_test1', - 'rolloutId': 'rollout-12672-16935023792', 'variables': []}, - {'experimentIds': ['16910084756'], 'id': '16928980973', 'key': 'feature_2', - 'rolloutId': '16917900798', 'variables': []}, - {'experimentIds': [], 'id': '16923312421', 'key': 'feature_5', 'rolloutId': '16917103311', - 'variables': []}, - {'experimentIds': [], 'id': '16925981047', 'key': 'feature_1', 'rolloutId': '16928980969', - 'variables': [ - {'defaultValue': 'true', 'id': '16932993089', 'key': 'bool_var', 'type': 'boolean'}, - {'defaultValue': '5.6', 'id': '16923002469', 'key': 'double_var', 'type': 'double'}, - {'defaultValue': '1', 'id': '16937161477', 'key': 'int_var', 'type': 'integer'}, - {'defaultValue': 'hello', 'id': '16916052157', 'key': 'str_var', 'type': 'string'}]}, - {'experimentIds': [], 'id': '16907463855', 'key': 'feature_3', 'rolloutId': '16909553406', - 'variables': []}, - {'experimentIds': [], 'id': '16912161768', 'key': 'feature_4', 'rolloutId': '16943340293', - 'variables': []}], 'groups': [], 'projectId': '16931203314', 'revision': '131', - 'rollouts': [{'experiments': [{'audienceConditions': [], 'audienceIds': [], 'forcedVariations': {}, - 'id': 'default-rollout-12672-16935023792', - 'key': 'default-rollout-12672-16935023792', - 'layerId': 'rollout-12672-16935023792', 'status': 'Running', - 'trafficAllocation': [{'endOfRange': 10000, 'entityId': '35771'}], - 'variations': [{'featureEnabled': False, 'id': '35771', 'key': 'off', - 'variables': []}]}], 'id': 'rollout-12672-16935023792'}, { - 'experiments': [ - {'audienceConditions': ['or', '16902921321'], 'audienceIds': ['16902921321'], - 'forcedVariations': {}, 'id': '16924931120', 'key': '16924931120', - 'layerId': '16917900798', 'status': 'Running', - 'trafficAllocation': [{'endOfRange': 10000, 'entityId': '16931381940'}], - 'variations': [{'featureEnabled': True, 'id': '16931381940', 'key': '16931381940', - 'variables': []}]}, - {'audienceConditions': [], 'audienceIds': [], 'forcedVariations': {}, - 'id': '18234756110', 'key': '18234756110', 'layerId': '16917900798', - 'status': 'Running', 'trafficAllocation': [], 'variations': [ - {'featureEnabled': True, 'id': '18244927831', 'key': '18244927831', - 'variables': []}]}, - {'audienceConditions': [], 'audienceIds': [], 'forcedVariations': {}, - 'id': 'default-16917900798', 'key': 'default-16917900798', - 'layerId': '16917900798', 'status': 'Running', - 'trafficAllocation': [{'endOfRange': 10000, 'entityId': '35770'}], 'variations': [ - {'featureEnabled': False, 'id': '35770', 'key': 'off', 'variables': []}]}], - 'id': '16917900798'}, {'experiments': [ - {'audienceConditions': [], 'audienceIds': [], 'forcedVariations': {}, 'id': '16932940705', - 'key': '16932940705', 'layerId': '16917103311', 'status': 'Running', - 'trafficAllocation': [{'endOfRange': 10000, 'entityId': '16927890136'}], - 'variations': [{'featureEnabled': True, 'id': '16927890136', 'key': '16927890136', 'variables': []}]}, - {'audienceConditions': [], 'audienceIds': [], 'forcedVariations': {}, 'id': 'default-16917103311', - 'key': 'default-16917103311', 'layerId': '16917103311', 'status': 'Running', - 'trafficAllocation': [{'endOfRange': 10000, 'entityId': '35769'}], - 'variations': [{'featureEnabled': False, 'id': '35769', 'key': 'off', 'variables': []}]}], - 'id': '16917103311'}, {'experiments': [ - {'audienceConditions': ['or', '16902921321'], 'audienceIds': ['16902921321'], 'forcedVariations': {}, - 'id': '16941022436', 'key': '16941022436', 'layerId': '16928980969', 'status': 'Running', - 'trafficAllocation': [{'endOfRange': 10000, 'entityId': '16906801184'}], 'variations': [ - {'featureEnabled': True, 'id': '16906801184', 'key': '16906801184', - 'variables': [{'id': '16932993089', 'value': 'true'}, {'id': '16923002469', 'value': '5.6'}, - {'id': '16937161477', 'value': '1'}, {'id': '16916052157', 'value': 'hello'}]}]}, - {'audienceConditions': [], 'audienceIds': [], 'forcedVariations': {}, 'id': '18263416053', - 'key': '18263416053', 'layerId': '16928980969', 'status': 'Running', 'trafficAllocation': [], - 'variations': [{'featureEnabled': True, 'id': '18317043587', 'key': '18317043587', - 'variables': [{'id': '16932993089', 'value': 'true'}, - {'id': '16923002469', 'value': '5.6'}, - {'id': '16937161477', 'value': '1'}, - {'id': '16916052157', 'value': 'hello'}]}]}, - {'audienceConditions': [], 'audienceIds': [], 'forcedVariations': {}, 'id': 'default-16928980969', - 'key': 'default-16928980969', 'layerId': '16928980969', 'status': 'Running', - 'trafficAllocation': [{'endOfRange': 10000, 'entityId': '35768'}], 'variations': [ - {'featureEnabled': False, 'id': '35768', 'key': 'off', - 'variables': [{'id': '16932993089', 'value': 'true'}, {'id': '16923002469', 'value': '5.6'}, - {'id': '16937161477', 'value': '1'}, {'id': '16916052157', 'value': 'hello'}]}]}], - 'id': '16928980969'}, {'experiments': [ - {'audienceConditions': [], 'audienceIds': [], 'forcedVariations': {}, 'id': '16907440927', - 'key': '16907440927', 'layerId': '16909553406', 'status': 'Running', 'trafficAllocation': [], - 'variations': [{'featureEnabled': True, 'id': '16908510336', 'key': '16908510336', 'variables': []}]}, - {'audienceConditions': [], 'audienceIds': [], 'forcedVariations': {}, 'id': 'default-16909553406', - 'key': 'default-16909553406', 'layerId': '16909553406', 'status': 'Running', - 'trafficAllocation': [{'endOfRange': 10000, 'entityId': '35767'}], - 'variations': [{'featureEnabled': False, 'id': '35767', 'key': 'off', 'variables': []}]}], - 'id': '16909553406'}, - {'experiments': [ - {'audienceConditions': [], 'audienceIds': [], 'forcedVariations': {}, 'id': '16939051724', - 'key': '16939051724', 'layerId': '16943340293', 'status': 'Running', - 'trafficAllocation': [{'endOfRange': 10000, 'entityId': '16925940659'}], 'variations': [ - {'featureEnabled': True, 'id': '16925940659', 'key': '16925940659', 'variables': []}]}, - {'audienceConditions': [], 'audienceIds': [], 'forcedVariations': {}, - 'id': 'default-16943340293', 'key': 'default-16943340293', - 'layerId': '16943340293', 'status': 'Running', - 'trafficAllocation': [{'endOfRange': 10000, 'entityId': '35766'}], - 'variations': [{'featureEnabled': False, 'id': '35766', 'key': 'off', 'variables': []}]}], - 'id': '16943340293'}], 'sdkKey': 'KZbunNn9bVfBWLpZPq2XC4', 'typedAudiences': [], - 'variables': [], 'version': '4'} +datafile = { + "accountId": "10845721364", + "anonymizeIP": True, + "attributes": [ + { + "id": "16921322086", + "key": "attr_1" + } + ], + "audiences": [ + { + "conditions": "[\"and\", [\"or\", [\"or\", {\"match\": \"exact\", \"name\": \"attr_1\", \"type\": \"custom_attribute\", \"value\": \"hola\"}]]]", + "id": "16902921321", + "name": "Audience1" + }, + { + "conditions": "[\"or\", {\"match\": \"exact\", \"name\": \"$opt_dummy_attribute\", \"type\": \"custom_attribute\", \"value\": \"$opt_dummy_value\"}]", + "id": "$opt_dummy_audience", + "name": "Optimizely-Generated Audience for Backwards Compatibility" + } + ], + "botFiltering": False, + "environmentKey": "production", + "events": [ + { + "experimentIds": [ + "16911963060", + "16910084756" + ], + "id": "16911532385", + "key": "myevent" + } + ], + "experiments": [ + { + "audienceConditions": [ + "or", + "16902921321" + ], + "audienceIds": [ + "16902921321" + ], + "forcedVariations": {}, + "id": "16910084756", + "key": "feature_2_test", + "layerId": "16933431472", + "status": "Running", + "trafficAllocation": [ + { + "endOfRange": 5000, + "entityId": "16925360560" + }, + { + "endOfRange": 10000, + "entityId": "16925360560" + } + ], + "variations": [ + { + "featureEnabled": True, + "id": "16925360560", + "key": "variation_1", + "variables": [] + }, + { + "featureEnabled": True, + "id": "16915611472", + "key": "variation_2", + "variables": [] + } + ] + }, + { + "audienceConditions": [ + "or", + "16902921321" + ], + "audienceIds": [ + "16902921321" + ], + "forcedVariations": {}, + "id": "16911963060", + "key": "ab_test1", + "layerId": "16916031507", + "status": "Running", + "trafficAllocation": [ + { + "endOfRange": 1000, + "entityId": "16905941566" + }, + { + "endOfRange": 5000, + "entityId": "16905941566" + }, + { + "endOfRange": 8000, + "entityId": "16905941566" + }, + { + "endOfRange": 9000, + "entityId": "16905941566" + }, + { + "endOfRange": 10000, + "entityId": "16905941566" + } + ], + "variations": [ + { + "featureEnabled": True, + "id": "16905941566", + "key": "variation_1", + "variables": [] + }, + { + "featureEnabled": True, + "id": "16927770169", + "key": "variation_2", + "variables": [] + } + ] + } + ], + "featureFlags": [ + { + "experimentIds": [], + "id": "16907463855", + "key": "feature_3", + "rolloutId": "16909553406", + "variables": [] + }, + { + "experimentIds": [], + "id": "16912161768", + "key": "feature_4", + "rolloutId": "16943340293", + "variables": [] + }, + { + "experimentIds": [], + "id": "16923312421", + "key": "feature_5", + "rolloutId": "16917103311", + "variables": [] + }, + { + "experimentIds": [], + "id": "16925981047", + "key": "feature_1", + "rolloutId": "16928980969", + "variables": [ + { + "defaultValue": "hello", + "id": "16916052157", + "key": "str_var", + "type": "string" + }, + { + "defaultValue": "5.6", + "id": "16923002469", + "key": "double_var", + "type": "double" + }, + { + "defaultValue": "true", + "id": "16932993089", + "key": "bool_var", + "type": "boolean" + }, + { + "defaultValue": "1", + "id": "16937161477", + "key": "int_var", + "type": "integer" + } + ] + }, + { + "experimentIds": [ + "16910084756" + ], + "id": "16928980973", + "key": "feature_2", + "rolloutId": "16917900798", + "variables": [] + }, + { + "experimentIds": [ + "16911963060" + ], + "id": "147680", + "key": "GkbzTurBWXr8EtNGZj2j6e", + "rolloutId": "rollout-147680-16935023792", + "variables": [] + } + ], + "groups": [], + "integrations": [], + "projectId": "16931203314", + "revision": "137", + "rollouts": [ + { + "experiments": [ + { + "audienceConditions": [], + "audienceIds": [], + "forcedVariations": {}, + "id": "default-16909553406", + "key": "default-16909553406", + "layerId": "16909553406", + "status": "Running", + "trafficAllocation": [ + { + "endOfRange": 10000, + "entityId": "471185" + } + ], + "variations": [ + { + "featureEnabled": False, + "id": "471185", + "key": "off", + "variables": [] + } + ] + } + ], + "id": "16909553406" + }, + { + "experiments": [ + { + "audienceConditions": [], + "audienceIds": [], + "forcedVariations": {}, + "id": "default-16943340293", + "key": "default-16943340293", + "layerId": "16943340293", + "status": "Running", + "trafficAllocation": [ + { + "endOfRange": 10000, + "entityId": "16925940659" + } + ], + "variations": [ + { + "featureEnabled": True, + "id": "16925940659", + "key": "16925940659", + "variables": [] + } + ] + } + ], + "id": "16943340293" + }, + { + "experiments": [ + { + "audienceConditions": [], + "audienceIds": [], + "forcedVariations": {}, + "id": "default-16917103311", + "key": "default-16917103311", + "layerId": "16917103311", + "status": "Running", + "trafficAllocation": [ + { + "endOfRange": 10000, + "entityId": "16927890136" + } + ], + "variations": [ + { + "featureEnabled": True, + "id": "16927890136", + "key": "16927890136", + "variables": [] + } + ] + } + ], + "id": "16917103311" + }, + { + "experiments": [ + { + "audienceConditions": [ + "or", + "16902921321" + ], + "audienceIds": [ + "16902921321" + ], + "forcedVariations": {}, + "id": "16941022436", + "key": "16941022436", + "layerId": "16928980969", + "status": "Running", + "trafficAllocation": [ + { + "endOfRange": 10000, + "entityId": "16906801184" + } + ], + "variations": [ + { + "featureEnabled": True, + "id": "16906801184", + "key": "16906801184", + "variables": [ + { + "id": "16916052157", + "value": "hello" + }, + { + "id": "16923002469", + "value": "5.6" + }, + { + "id": "16932993089", + "value": "true" + }, + { + "id": "16937161477", + "value": "1" + } + ] + } + ] + }, + { + "audienceConditions": [], + "audienceIds": [], + "forcedVariations": {}, + "id": "default-16928980969", + "key": "default-16928980969", + "layerId": "16928980969", + "status": "Running", + "trafficAllocation": [ + { + "endOfRange": 10000, + "entityId": "471188" + } + ], + "variations": [ + { + "featureEnabled": False, + "id": "471188", + "key": "off", + "variables": [ + { + "id": "16916052157", + "value": "hello" + }, + { + "id": "16923002469", + "value": "5.6" + }, + { + "id": "16932993089", + "value": "true" + }, + { + "id": "16937161477", + "value": "1" + } + ] + } + ] + } + ], + "id": "16928980969" + }, + { + "experiments": [ + { + "audienceConditions": [ + "or", + "16902921321" + ], + "audienceIds": [ + "16902921321" + ], + "forcedVariations": {}, + "id": "16924931120", + "key": "16924931120", + "layerId": "16917900798", + "status": "Running", + "trafficAllocation": [ + { + "endOfRange": 10000, + "entityId": "16931381940" + } + ], + "variations": [ + { + "featureEnabled": True, + "id": "16931381940", + "key": "16931381940", + "variables": [] + } + ] + }, + { + "audienceConditions": [], + "audienceIds": [], + "forcedVariations": {}, + "id": "default-16917900798", + "key": "default-16917900798", + "layerId": "16917900798", + "status": "Running", + "trafficAllocation": [ + { + "endOfRange": 10000, + "entityId": "471189" + } + ], + "variations": [ + { + "featureEnabled": False, + "id": "471189", + "key": "off", + "variables": [] + } + ] + } + ], + "id": "16917900798" + }, + { + "experiments": [ + { + "audienceConditions": [], + "audienceIds": [], + "forcedVariations": {}, + "id": "default-rollout-147680-16935023792", + "key": "default-rollout-147680-16935023792", + "layerId": "rollout-147680-16935023792", + "status": "Running", + "trafficAllocation": [ + { + "endOfRange": 10000, + "entityId": "471190" + } + ], + "variations": [ + { + "featureEnabled": False, + "id": "471190", + "key": "off", + "variables": [] + } + ] + } + ], + "id": "rollout-147680-16935023792" + } + ], + "sdkKey": "KZbunNn9bVfBWLpZPq2XC4", + "typedAudiences": [], + "variables": [], + "version": "4" +} diff --git a/tests/acceptance/odp_datafile.py b/tests/acceptance/odp_datafile.py index cef96e79..c3d346cf 100644 --- a/tests/acceptance/odp_datafile.py +++ b/tests/acceptance/odp_datafile.py @@ -157,7 +157,8 @@ { "publicKey": "ax6UV2223fD-jpOXID0BMg", "host": "https://api.zaius.com", - "key": "odp" + "key": "odp", + "pixelUrl": "https://jumbe.zaius.com", } ], "experiments": [ @@ -242,5 +243,5 @@ "key": "myevent" } ], - "revision": "18" -} \ No newline at end of file + "revision": "19" +} diff --git a/tests/acceptance/test_acceptance/test_activate.py b/tests/acceptance/test_acceptance/test_activate.py index 3580e440..dbfbc5d0 100644 --- a/tests/acceptance/test_acceptance/test_activate.py +++ b/tests/acceptance/test_acceptance/test_activate.py @@ -223,7 +223,7 @@ def test_activate__feature(session_obj, feature_key, expected_response, { "userId": "matjaz", "experimentKey": "ab_test1", - "featureKey": "flag_ab_test1", + "featureKey": "GkbzTurBWXr8EtNGZj2j6e", "variationKey": "variation_1", "type": "feature", "enabled": true @@ -496,7 +496,7 @@ def test_activate__enabled(session_obj, enabled, experimentKey, featureKey, { "enabled": true, "experimentKey": "ab_test1", - "featureKey": "flag_ab_test1", + "featureKey": "GkbzTurBWXr8EtNGZj2j6e", "type": "feature", "userId": "matjaz", "variationKey": "variation_1" diff --git a/tests/acceptance/test_acceptance/test_batch.py b/tests/acceptance/test_acceptance/test_batch.py index 5e92dc93..113120e9 100644 --- a/tests/acceptance/test_acceptance/test_batch.py +++ b/tests/acceptance/test_acceptance/test_batch.py @@ -186,7 +186,7 @@ def test_batch_valid_reponse(session_obj): "variablesMap": {} } }, - "revision": "21", + "revision": "22", "sdkKey": "TkB2xhu8WEAHa4LphN3xZ2" }""" diff --git a/tests/acceptance/test_acceptance/test_config.py b/tests/acceptance/test_acceptance/test_config.py index be4b01cc..ef99efa8 100644 --- a/tests/acceptance/test_acceptance/test_config.py +++ b/tests/acceptance/test_acceptance/test_config.py @@ -7,477 +7,387 @@ from tests.acceptance.helpers import create_and_validate_request_and_response expected_config = """{ - "environmentKey": "production", - "sdkKey": "KZbunNn9bVfBWLpZPq2XC4", - "revision": "131", - "experimentsMap": { - "ab_test1": { - "id": "16911963060", - "key": "ab_test1", - "audiences": "\\"Audience1\\"", - "variationsMap": { - "variation_1": { - "id": "16905941566", - "key": "variation_1", - "featureEnabled": true, - "variablesMap": {} - }, - "variation_2": { - "id": "16927770169", - "key": "variation_2", - "featureEnabled": true, - "variablesMap": {} - } - } - }, - "feature_2_test": { - "id": "16910084756", - "key": "feature_2_test", - "audiences": "\\"Audience1\\"", - "variationsMap": { - "variation_1": { - "id": "16925360560", - "key": "variation_1", - "featureEnabled": true, - "variablesMap": {} - }, - "variation_2": { - "id": "16915611472", - "key": "variation_2", - "featureEnabled": true, - "variablesMap": {} - } - } - } - }, - "featuresMap": { - "feature_1": { - "id": "16925981047", - "key": "feature_1", - "experimentRules": [], - "deliveryRules": [ - { - "id": "16941022436", - "key": "16941022436", - "audiences": "\\"Audience1\\"", - "variationsMap": { - "16906801184": { - "id": "16906801184", - "key": "16906801184", - "featureEnabled": true, - "variablesMap": { - "bool_var": { - "id": "16932993089", - "key": "bool_var", - "type": "boolean", - "value": "true" - }, - "double_var": { - "id": "16923002469", - "key": "double_var", - "type": "double", - "value": "5.6" - }, - "int_var": { - "id": "16937161477", - "key": "int_var", - "type": "integer", - "value": "1" + "environmentKey": "production", + "sdkKey": "KZbunNn9bVfBWLpZPq2XC4", + "revision": "137", + "experimentsMap": { + "ab_test1": { + "id": "16911963060", + "key": "ab_test1", + "audiences": "\\"Audience1\\"", + "variationsMap": { + "variation_1": { + "id": "16905941566", + "key": "variation_1", + "featureEnabled": true, + "variablesMap": {} }, - "str_var": { - "id": "16916052157", - "key": "str_var", - "type": "string", - "value": "hello" + "variation_2": { + "id": "16927770169", + "key": "variation_2", + "featureEnabled": true, + "variablesMap": {} } - } } - } }, - { - "id": "18263416053", - "key": "18263416053", - "audiences": "", - "variationsMap": { - "18317043587": { - "id": "18317043587", - "key": "18317043587", - "featureEnabled": true, - "variablesMap": { - "bool_var": { - "id": "16932993089", - "key": "bool_var", - "type": "boolean", - "value": "true" - }, - "double_var": { - "id": "16923002469", - "key": "double_var", - "type": "double", - "value": "5.6" - }, - "int_var": { - "id": "16937161477", - "key": "int_var", - "type": "integer", - "value": "1" + "feature_2_test": { + "id": "16910084756", + "key": "feature_2_test", + "audiences": "\\"Audience1\\"", + "variationsMap": { + "variation_1": { + "id": "16925360560", + "key": "variation_1", + "featureEnabled": true, + "variablesMap": {} }, - "str_var": { - "id": "16916052157", - "key": "str_var", - "type": "string", - "value": "hello" + "variation_2": { + "id": "16915611472", + "key": "variation_2", + "featureEnabled": true, + "variablesMap": {} + } + } + } + }, + "featuresMap": { + "GkbzTurBWXr8EtNGZj2j6e": { + "id": "147680", + "key": "GkbzTurBWXr8EtNGZj2j6e", + "experimentRules": [ + { + "id": "16911963060", + "key": "ab_test1", + "audiences": "\\"Audience1\\"", + "variationsMap": { + "variation_1": { + "id": "16905941566", + "key": "variation_1", + "featureEnabled": true, + "variablesMap": {} + }, + "variation_2": { + "id": "16927770169", + "key": "variation_2", + "featureEnabled": true, + "variablesMap": {} + } + } + } + ], + "deliveryRules": [ + { + "id": "default-rollout-147680-16935023792", + "key": "default-rollout-147680-16935023792", + "audiences": "", + "variationsMap": { + "off": { + "id": "471190", + "key": "off", + "featureEnabled": false, + "variablesMap": {} + } + } + } + ], + "variablesMap": {}, + "experimentsMap": { + "ab_test1": { + "id": "16911963060", + "key": "ab_test1", + "audiences": "\\"Audience1\\"", + "variationsMap": { + "variation_1": { + "id": "16905941566", + "key": "variation_1", + "featureEnabled": true, + "variablesMap": {} + }, + "variation_2": { + "id": "16927770169", + "key": "variation_2", + "featureEnabled": true, + "variablesMap": {} + } + } } - } } - } }, - { - "id": "default-16928980969", - "key": "default-16928980969", - "audiences": "", - "variationsMap": { - "off": { - "id": "35768", - "key": "off", - "featureEnabled": false, - "variablesMap": { + "feature_1": { + "id": "16925981047", + "key": "feature_1", + "experimentRules": [], + "deliveryRules": [ + { + "id": "16941022436", + "key": "16941022436", + "audiences": "\\"Audience1\\"", + "variationsMap": { + "16906801184": { + "id": "16906801184", + "key": "16906801184", + "featureEnabled": true, + "variablesMap": { + "bool_var": { + "id": "16932993089", + "key": "bool_var", + "type": "boolean", + "value": "true" + }, + "double_var": { + "id": "16923002469", + "key": "double_var", + "type": "double", + "value": "5.6" + }, + "int_var": { + "id": "16937161477", + "key": "int_var", + "type": "integer", + "value": "1" + }, + "str_var": { + "id": "16916052157", + "key": "str_var", + "type": "string", + "value": "hello" + } + } + } + } + }, + { + "id": "default-16928980969", + "key": "default-16928980969", + "audiences": "", + "variationsMap": { + "off": { + "id": "471188", + "key": "off", + "featureEnabled": false, + "variablesMap": { + "bool_var": { + "id": "16932993089", + "key": "bool_var", + "type": "boolean", + "value": "true" + }, + "double_var": { + "id": "16923002469", + "key": "double_var", + "type": "double", + "value": "5.6" + }, + "int_var": { + "id": "16937161477", + "key": "int_var", + "type": "integer", + "value": "1" + }, + "str_var": { + "id": "16916052157", + "key": "str_var", + "type": "string", + "value": "hello" + } + } + } + } + } + ], + "variablesMap": { "bool_var": { - "id": "16932993089", - "key": "bool_var", - "type": "boolean", - "value": "true" + "id": "16932993089", + "key": "bool_var", + "type": "boolean", + "value": "true" }, "double_var": { - "id": "16923002469", - "key": "double_var", - "type": "double", - "value": "5.6" + "id": "16923002469", + "key": "double_var", + "type": "double", + "value": "5.6" }, "int_var": { - "id": "16937161477", - "key": "int_var", - "type": "integer", - "value": "1" + "id": "16937161477", + "key": "int_var", + "type": "integer", + "value": "1" }, "str_var": { - "id": "16916052157", - "key": "str_var", - "type": "string", - "value": "hello" + "id": "16916052157", + "key": "str_var", + "type": "string", + "value": "hello" } - } - } - } - } - ], - "variablesMap": { - "bool_var": { - "id": "16932993089", - "key": "bool_var", - "type": "boolean", - "value": "true" - }, - "double_var": { - "id": "16923002469", - "key": "double_var", - "type": "double", - "value": "5.6" - }, - "int_var": { - "id": "16937161477", - "key": "int_var", - "type": "integer", - "value": "1" - }, - "str_var": { - "id": "16916052157", - "key": "str_var", - "type": "string", - "value": "hello" - } - }, - "experimentsMap": {} - }, - "feature_2": { - "id": "16928980973", - "key": "feature_2", - "experimentRules": [ - { - "id": "16910084756", - "key": "feature_2_test", - "audiences": "\\"Audience1\\"", - "variationsMap": { - "variation_1": { - "id": "16925360560", - "key": "variation_1", - "featureEnabled": true, - "variablesMap": {} }, - "variation_2": { - "id": "16915611472", - "key": "variation_2", - "featureEnabled": true, - "variablesMap": {} - } - } - } - ], - "deliveryRules": [ - { - "id": "16924931120", - "key": "16924931120", - "audiences": "\\"Audience1\\"", - "variationsMap": { - "16931381940": { - "id": "16931381940", - "key": "16931381940", - "featureEnabled": true, - "variablesMap": {} - } - } + "experimentsMap": {} }, - { - "id": "18234756110", - "key": "18234756110", - "audiences": "", - "variationsMap": { - "18244927831": { - "id": "18244927831", - "key": "18244927831", - "featureEnabled": true, - "variablesMap": {} + "feature_2": { + "id": "16928980973", + "key": "feature_2", + "experimentRules": [ + { + "id": "16910084756", + "key": "feature_2_test", + "audiences": "\\"Audience1\\"", + "variationsMap": { + "variation_1": { + "id": "16925360560", + "key": "variation_1", + "featureEnabled": true, + "variablesMap": {} + }, + "variation_2": { + "id": "16915611472", + "key": "variation_2", + "featureEnabled": true, + "variablesMap": {} + } + } + } + ], + "deliveryRules": [ + { + "id": "16924931120", + "key": "16924931120", + "audiences": "\\"Audience1\\"", + "variationsMap": { + "16931381940": { + "id": "16931381940", + "key": "16931381940", + "featureEnabled": true, + "variablesMap": {} + } + } + }, + { + "id": "default-16917900798", + "key": "default-16917900798", + "audiences": "", + "variationsMap": { + "off": { + "id": "471189", + "key": "off", + "featureEnabled": false, + "variablesMap": {} + } + } + } + ], + "variablesMap": {}, + "experimentsMap": { + "feature_2_test": { + "id": "16910084756", + "key": "feature_2_test", + "audiences": "\\"Audience1\\"", + "variationsMap": { + "variation_1": { + "id": "16925360560", + "key": "variation_1", + "featureEnabled": true, + "variablesMap": {} + }, + "variation_2": { + "id": "16915611472", + "key": "variation_2", + "featureEnabled": true, + "variablesMap": {} + } + } + } } - } }, - { - "id": "default-16917900798", - "key": "default-16917900798", - "audiences": "", - "variationsMap": { - "off": { - "id": "35770", - "key": "off", - "featureEnabled": false, - "variablesMap": {} - } - } - } - ], - "variablesMap": {}, - "experimentsMap": { - "feature_2_test": { - "id": "16910084756", - "key": "feature_2_test", - "audiences": "\\"Audience1\\"", - "variationsMap": { - "variation_1": { - "id": "16925360560", - "key": "variation_1", - "featureEnabled": true, - "variablesMap": {} - }, - "variation_2": { - "id": "16915611472", - "key": "variation_2", - "featureEnabled": true, - "variablesMap": {} - } - } - } - } - }, - "feature_3": { - "id": "16907463855", - "key": "feature_3", - "experimentRules": [], - "deliveryRules": [ - { - "id": "16907440927", - "key": "16907440927", - "audiences": "", - "variationsMap": { - "16908510336": { - "id": "16908510336", - "key": "16908510336", - "featureEnabled": true, - "variablesMap": {} - } - } + "feature_3": { + "id": "16907463855", + "key": "feature_3", + "experimentRules": [], + "deliveryRules": [ + { + "id": "default-16909553406", + "key": "default-16909553406", + "audiences": "", + "variationsMap": { + "off": { + "id": "471185", + "key": "off", + "featureEnabled": false, + "variablesMap": {} + } + } + } + ], + "variablesMap": {}, + "experimentsMap": {} }, - { - "id": "default-16909553406", - "key": "default-16909553406", - "audiences": "", - "variationsMap": { - "off": { - "id": "35767", - "key": "off", - "featureEnabled": false, - "variablesMap": {} - } - } - } - ], - "variablesMap": {}, - "experimentsMap": {} - }, - "feature_4": { - "id": "16912161768", - "key": "feature_4", - "experimentRules": [], - "deliveryRules": [ - { - "id": "16939051724", - "key": "16939051724", - "audiences": "", - "variationsMap": { - "16925940659": { - "id": "16925940659", - "key": "16925940659", - "featureEnabled": true, - "variablesMap": {} - } - } + "feature_4": { + "id": "16912161768", + "key": "feature_4", + "experimentRules": [], + "deliveryRules": [ + { + "id": "default-16943340293", + "key": "default-16943340293", + "audiences": "", + "variationsMap": { + "16925940659": { + "id": "16925940659", + "key": "16925940659", + "featureEnabled": true, + "variablesMap": {} + } + } + } + ], + "variablesMap": {}, + "experimentsMap": {} }, - { - "id": "default-16943340293", - "key": "default-16943340293", - "audiences": "", - "variationsMap": { - "off": { - "id": "35766", - "key": "off", - "featureEnabled": false, - "variablesMap": {} - } - } + "feature_5": { + "id": "16923312421", + "key": "feature_5", + "experimentRules": [], + "deliveryRules": [ + { + "id": "default-16917103311", + "key": "default-16917103311", + "audiences": "", + "variationsMap": { + "16927890136": { + "id": "16927890136", + "key": "16927890136", + "featureEnabled": true, + "variablesMap": {} + } + } + } + ], + "variablesMap": {}, + "experimentsMap": {} } - ], - "variablesMap": {}, - "experimentsMap": {} }, - "feature_5": { - "id": "16923312421", - "key": "feature_5", - "experimentRules": [], - "deliveryRules": [ - { - "id": "16932940705", - "key": "16932940705", - "audiences": "", - "variationsMap": { - "16927890136": { - "id": "16927890136", - "key": "16927890136", - "featureEnabled": true, - "variablesMap": {} - } - } - }, + "attributes": [ { - "id": "default-16917103311", - "key": "default-16917103311", - "audiences": "", - "variationsMap": { - "off": { - "id": "35769", - "key": "off", - "featureEnabled": false, - "variablesMap": {} - } - } + "id": "16921322086", + "key": "attr_1" } - ], - "variablesMap": {}, - "experimentsMap": {} - }, - "flag_ab_test1": { - "id": "12672", - "key": "flag_ab_test1", - "experimentRules": [ + ], + "audiences": [ { - "id": "16911963060", - "key": "ab_test1", - "audiences": "\\"Audience1\\"", - "variationsMap": { - "variation_1": { - "id": "16905941566", - "key": "variation_1", - "featureEnabled": true, - "variablesMap": {} - }, - "variation_2": { - "id": "16927770169", - "key": "variation_2", - "featureEnabled": true, - "variablesMap": {} - } - } + "id": "16902921321", + "name": "Audience1", + "conditions": "[\\"and\\", [\\"or\\", [\\"or\\", {\\"match\\": \\"exact\\", \\"name\\": \\"attr_1\\", \\"type\\": \\"custom_attribute\\", \\"value\\": \\"hola\\"}]]]" } - ], - "deliveryRules": [ + ], + "events": [ { - "id": "default-rollout-12672-16935023792", - "key": "default-rollout-12672-16935023792", - "audiences": "", - "variationsMap": { - "off": { - "id": "35771", - "key": "off", - "featureEnabled": false, - "variablesMap": {} - } - } - } - ], - "variablesMap": {}, - "experimentsMap": { - "ab_test1": { - "id": "16911963060", - "key": "ab_test1", - "audiences": "\\"Audience1\\"", - "variationsMap": { - "variation_1": { - "id": "16905941566", - "key": "variation_1", - "featureEnabled": true, - "variablesMap": {} - }, - "variation_2": { - "id": "16927770169", - "key": "variation_2", - "featureEnabled": true, - "variablesMap": {} - } - } + "id": "16911532385", + "key": "myevent", + "experimentIds": [ + "16911963060", + "16910084756" + ] } - } - } - }, - "attributes": [ - { - "id": "16921322086", - "key": "attr_1" - } - ], - "audiences": [ - { - "id": "16902921321", - "name": "Audience1", - "conditions": "[\\"and\\", [\\"or\\", [\\"or\\", {\\"match\\": \\"exact\\", \\"name\\": \\"attr_1\\", \\"type\\": \\"custom_attribute\\", \\"value\\": \\"hola\\"}]]]" - } - ], - "events": [ - { - "id": "16911532385", - "key": "myevent", - "experimentIds": [ - "16910084756", - "16911963060" - ] - } - ] + ] }""" diff --git a/tests/acceptance/test_acceptance/test_decide.py b/tests/acceptance/test_acceptance/test_decide.py index cb18908e..6b39e319 100644 --- a/tests/acceptance/test_acceptance/test_decide.py +++ b/tests/acceptance/test_acceptance/test_decide.py @@ -156,15 +156,18 @@ def test_decide__feature_no_ups(session_obj, flag_key, expected_response, expect { "variationKey": "16925940659", "enabled": true, - "ruleKey": "16939051724", + "ruleKey": "default-16943340293", "flagKey": "feature_4", "userContext": {"userId": "matjaz", "attributes": {"attr_1": "hola"}}, - "reasons": ["Audiences for experiment 16939051724 collectively evaluated to true."]}, + "reasons": [ + "Audiences for experiment default-16943340293 collectively evaluated to true.", + "User \"matjaz\" meets conditions for targeting rule \"Everyone Else\"." + ]}, { "variationKey": "variation_1", "enabled": true, "ruleKey": "ab_test1", - "flagKey": "flag_ab_test1", + "flagKey": "GkbzTurBWXr8EtNGZj2j6e", "userContext": {"userId": "matjaz", "attributes": {"attr_1": "hola"}}, "reasons": ["User \"matjaz\" was previously bucketed into variation \"variation_1\" of experiment \"ab_test1\"."]}, { @@ -177,10 +180,13 @@ def test_decide__feature_no_ups(session_obj, flag_key, expected_response, expect { "variationKey": "16927890136", "enabled": true, - "ruleKey": "16932940705", + "ruleKey": "default-16917103311", "flagKey": "feature_5", "userContext": {"userId": "matjaz", "attributes": {"attr_1": "hola"}}, - "reasons": ["Audiences for experiment 16932940705 collectively evaluated to true."]}, + "reasons": [ + "Audiences for experiment default-16917103311 collectively evaluated to true.", + "User \"matjaz\" meets conditions for targeting rule \"Everyone Else\"." + ]}, { "variationKey": "16906801184", "enabled": true, @@ -211,17 +217,23 @@ def test_decide__feature_no_ups(session_obj, flag_key, expected_response, expect { "variationKey": "16925940659", "enabled": true, - "ruleKey": "16939051724", + "ruleKey": "default-16943340293", "flagKey": "feature_4", "userContext": {"userId": "matjaz", "attributes": {"attr_1": "hola"}}, - "reasons": ["Audiences for experiment 16939051724 collectively evaluated to true."]}, + "reasons": [ + "Audiences for experiment default-16943340293 collectively evaluated to true.", + "User \"matjaz\" meets conditions for targeting rule \"Everyone Else\"." + ]}, { "variationKey": "16927890136", "enabled": true, - "ruleKey": "16932940705", + "ruleKey": "default-16917103311", "flagKey": "feature_5", "userContext": {"userId": "matjaz", "attributes": {"attr_1": "hola"}}, - "reasons": ["Audiences for experiment 16932940705 collectively evaluated to true."] + "reasons": [ + "Audiences for experiment default-16917103311 collectively evaluated to true.", + "User \"matjaz\" meets conditions for targeting rule \"Everyone Else\"." + ] } ]""" @@ -237,7 +249,7 @@ def test_decide__feature_no_ups(session_obj, flag_key, expected_response, expect "variationKey": "variation_1", "enabled": true, "ruleKey": "ab_test1", - "flagKey": "flag_ab_test1", + "flagKey": "GkbzTurBWXr8EtNGZj2j6e", "userContext": {"userId": "matjaz", "attributes": {"attr_1": "hola"}}, "reasons": ["Audiences for experiment ab_test1 collectively evaluated to true."]}, { @@ -284,17 +296,17 @@ def test_decide__feature_no_ups(session_obj, flag_key, expected_response, expect { "variationKey": "16925940659", "enabled": true, - "ruleKey": "16939051724", + "ruleKey": "default-16943340293", "flagKey": "feature_4", "userContext": {"userId": "matjaz", "attributes": {"attr_1": "hola"}}, - "reasons": ["Audiences for experiment 16939051724 collectively evaluated to true."]}, + "reasons": ["Audiences for experiment default-16943340293 collectively evaluated to true."]}, { "variationKey": "16927890136", "enabled": true, - "ruleKey": "16932940705", + "ruleKey": "default-16917103311", "flagKey": "feature_5", "userContext": {"userId": "matjaz", "attributes": {"attr_1": "hola"}}, - "reasons": ["Audiences for experiment 16932940705 collectively evaluated to true."] + "reasons": ["Audiences for experiment default-16917103311 collectively evaluated to true."] } ]"""