From 9f94c16a925799b378cd059d0c8d51eb0313b328 Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 2 Aug 2024 19:42:42 +0600 Subject: [PATCH 01/15] ci test --- config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yaml b/config.yaml index 431ddd6c..fa67c1b8 100644 --- a/config.yaml +++ b/config.yaml @@ -38,7 +38,7 @@ tracing: enabled: false # opentelemetry tracing configuration opentelemetry: - ## bydefault stdout exporter is enabled + ## bydefault stdout exporter is enabled (test) ## to enable remote exporter set default as "remote" default: "stdout" ## tracing service name From 0f0b981417d2367a11b3a15f19e537712a33dcae Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 13:32:31 +0600 Subject: [PATCH 02/15] update tests --- tests/acceptance/datafile.py | 580 ++++++++++--- tests/acceptance/odp_datafile.py | 7 +- .../test_acceptance/test_activate.py | 2 +- .../acceptance/test_acceptance/test_batch.py | 2 +- .../acceptance/test_acceptance/test_config.py | 792 ++++++++---------- .../acceptance/test_acceptance/test_decide.py | 10 +- 6 files changed, 827 insertions(+), 566 deletions(-) diff --git a/tests/acceptance/datafile.py b/tests/acceptance/datafile.py index 3b8d40d9..5c5c943f 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..d3720fcb 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 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..7dc03e57 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..9f9ffe14 100644 --- a/tests/acceptance/test_acceptance/test_decide.py +++ b/tests/acceptance/test_acceptance/test_decide.py @@ -237,7 +237,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 +284,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."] } ]""" From dc735585a0087dc9200cf4fc661504c719a5e845 Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 13:36:07 +0600 Subject: [PATCH 03/15] fix datafile json --- tests/acceptance/datafile.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/acceptance/datafile.py b/tests/acceptance/datafile.py index 5c5c943f..dd559755 100644 --- a/tests/acceptance/datafile.py +++ b/tests/acceptance/datafile.py @@ -1,6 +1,6 @@ datafile = { "accountId": "10845721364", - "anonymizeIP": true, + "anonymizeIP": ""true"", "attributes": [ { "id": "16921322086", @@ -19,7 +19,7 @@ "name": "Optimizely-Generated Audience for Backwards Compatibility" } ], - "botFiltering": false, + "botFiltering": ""false"", "environmentKey": "production", "events": [ { @@ -57,13 +57,13 @@ ], "variations": [ { - "featureEnabled": true, + "featureEnabled": "true", "id": "16925360560", "key": "variation_1", "variables": [] }, { - "featureEnabled": true, + "featureEnabled": "true", "id": "16915611472", "key": "variation_2", "variables": [] @@ -107,13 +107,13 @@ ], "variations": [ { - "featureEnabled": true, + "featureEnabled": "true", "id": "16905941566", "key": "variation_1", "variables": [] }, { - "featureEnabled": true, + "featureEnabled": "true", "id": "16927770169", "key": "variation_2", "variables": [] @@ -162,7 +162,7 @@ "type": "double" }, { - "defaultValue": "true", + "defaultValue": ""true"", "id": "16932993089", "key": "bool_var", "type": "boolean" @@ -217,7 +217,7 @@ ], "variations": [ { - "featureEnabled": false, + "featureEnabled": "false", "id": "471185", "key": "off", "variables": [] @@ -245,7 +245,7 @@ ], "variations": [ { - "featureEnabled": true, + "featureEnabled": "true", "id": "16925940659", "key": "16925940659", "variables": [] @@ -273,7 +273,7 @@ ], "variations": [ { - "featureEnabled": true, + "featureEnabled": "true", "id": "16927890136", "key": "16927890136", "variables": [] @@ -306,7 +306,7 @@ ], "variations": [ { - "featureEnabled": true, + "featureEnabled": "true", "id": "16906801184", "key": "16906801184", "variables": [ @@ -320,7 +320,7 @@ }, { "id": "16932993089", - "value": "true" + "value": ""true"" }, { "id": "16937161477", @@ -346,7 +346,7 @@ ], "variations": [ { - "featureEnabled": false, + "featureEnabled": "false", "id": "471188", "key": "off", "variables": [ @@ -360,7 +360,7 @@ }, { "id": "16932993089", - "value": "true" + "value": ""true"" }, { "id": "16937161477", @@ -396,7 +396,7 @@ ], "variations": [ { - "featureEnabled": true, + "featureEnabled": "true", "id": "16931381940", "key": "16931381940", "variables": [] @@ -419,7 +419,7 @@ ], "variations": [ { - "featureEnabled": false, + "featureEnabled": "false", "id": "471189", "key": "off", "variables": [] @@ -447,7 +447,7 @@ ], "variations": [ { - "featureEnabled": false, + "featureEnabled": "false", "id": "471190", "key": "off", "variables": [] From 50433919c27a597c3e86b8cb7f3c803856de2ef0 Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 13:38:48 +0600 Subject: [PATCH 04/15] fix json --- tests/acceptance/datafile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/datafile.py b/tests/acceptance/datafile.py index dd559755..fcae37be 100644 --- a/tests/acceptance/datafile.py +++ b/tests/acceptance/datafile.py @@ -1,6 +1,6 @@ datafile = { "accountId": "10845721364", - "anonymizeIP": ""true"", + "anonymizeIP": "true", "attributes": [ { "id": "16921322086", @@ -19,7 +19,7 @@ "name": "Optimizely-Generated Audience for Backwards Compatibility" } ], - "botFiltering": ""false"", + "botFiltering": "false", "environmentKey": "production", "events": [ { @@ -162,7 +162,7 @@ "type": "double" }, { - "defaultValue": ""true"", + "defaultValue": "true", "id": "16932993089", "key": "bool_var", "type": "boolean" @@ -320,7 +320,7 @@ }, { "id": "16932993089", - "value": ""true"" + "value": "true" }, { "id": "16937161477", @@ -360,7 +360,7 @@ }, { "id": "16932993089", - "value": ""true"" + "value": "true" }, { "id": "16937161477", From 58c0d4fdc2a1a9af3297f5435b1b3fa58b4319d9 Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 13:41:47 +0600 Subject: [PATCH 05/15] update tests --- tests/acceptance/test_acceptance/test_activate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/test_acceptance/test_activate.py b/tests/acceptance/test_acceptance/test_activate.py index d3720fcb..dbfbc5d0 100644 --- a/tests/acceptance/test_acceptance/test_activate.py +++ b/tests/acceptance/test_acceptance/test_activate.py @@ -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" From c246a69557bb3aae0dc7b2cb85477d01e34895ad Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 13:46:46 +0600 Subject: [PATCH 06/15] fix json --- .../acceptance/test_acceptance/test_config.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/acceptance/test_acceptance/test_config.py b/tests/acceptance/test_acceptance/test_config.py index 7dc03e57..8df1f526 100644 --- a/tests/acceptance/test_acceptance/test_config.py +++ b/tests/acceptance/test_acceptance/test_config.py @@ -14,7 +14,7 @@ "ab_test1": { "id": "16911963060", "key": "ab_test1", - "audiences": "\"Audience1\"", + "audiences": "Audience1", "variationsMap": { "variation_1": { "id": "16905941566", @@ -33,7 +33,7 @@ "feature_2_test": { "id": "16910084756", "key": "feature_2_test", - "audiences": "\"Audience1\"", + "audiences": "Audience1", "variationsMap": { "variation_1": { "id": "16925360560", @@ -58,7 +58,7 @@ { "id": "16911963060", "key": "ab_test1", - "audiences": "\"Audience1\"", + "audiences": "Audience1", "variationsMap": { "variation_1": { "id": "16905941566", @@ -95,7 +95,7 @@ "ab_test1": { "id": "16911963060", "key": "ab_test1", - "audiences": "\"Audience1\"", + "audiences": "Audience1", "variationsMap": { "variation_1": { "id": "16905941566", @@ -121,7 +121,7 @@ { "id": "16941022436", "key": "16941022436", - "audiences": "\"Audience1\"", + "audiences": "Audience1", "variationsMap": { "16906801184": { "id": "16906801184", @@ -230,7 +230,7 @@ { "id": "16910084756", "key": "feature_2_test", - "audiences": "\"Audience1\"", + "audiences": "Audience1", "variationsMap": { "variation_1": { "id": "16925360560", @@ -251,7 +251,7 @@ { "id": "16924931120", "key": "16924931120", - "audiences": "\"Audience1\"", + "audiences": "Audience1", "variationsMap": { "16931381940": { "id": "16931381940", @@ -280,7 +280,7 @@ "feature_2_test": { "id": "16910084756", "key": "feature_2_test", - "audiences": "\"Audience1\"", + "audiences": "Audience1", "variationsMap": { "variation_1": { "id": "16925360560", @@ -375,7 +375,7 @@ { "id": "16902921321", "name": "Audience1", - "conditions": "[\"and\", [\"or\", [\"or\", {\"match\": \"exact\", \"name\": \"attr_1\", \"type\": \"custom_attribute\", \"value\": \"hola\"}]]]" + "conditions": "[and, [or, [or, {match: exact, name: attr_1, type: custom_attribute, value: hola}]]]" } ], "events": [ From 1afd8536d8dc75d46586c7948e0f645c412058cb Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 13:57:48 +0600 Subject: [PATCH 07/15] fix json --- tests/acceptance/datafile.py | 34 +++++++++---------- .../acceptance/test_acceptance/test_config.py | 20 +++++------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/tests/acceptance/datafile.py b/tests/acceptance/datafile.py index fcae37be..1eb1c89e 100644 --- a/tests/acceptance/datafile.py +++ b/tests/acceptance/datafile.py @@ -1,6 +1,6 @@ datafile = { "accountId": "10845721364", - "anonymizeIP": "true", + "anonymizeIP": True, "attributes": [ { "id": "16921322086", @@ -19,7 +19,7 @@ "name": "Optimizely-Generated Audience for Backwards Compatibility" } ], - "botFiltering": "false", + "botFiltering": False, "environmentKey": "production", "events": [ { @@ -57,13 +57,13 @@ ], "variations": [ { - "featureEnabled": "true", + "featureEnabled": True, "id": "16925360560", "key": "variation_1", "variables": [] }, { - "featureEnabled": "true", + "featureEnabled": True, "id": "16915611472", "key": "variation_2", "variables": [] @@ -107,13 +107,13 @@ ], "variations": [ { - "featureEnabled": "true", + "featureEnabled": True, "id": "16905941566", "key": "variation_1", "variables": [] }, { - "featureEnabled": "true", + "featureEnabled": True, "id": "16927770169", "key": "variation_2", "variables": [] @@ -162,7 +162,7 @@ "type": "double" }, { - "defaultValue": "true", + "defaultValue": True, "id": "16932993089", "key": "bool_var", "type": "boolean" @@ -217,7 +217,7 @@ ], "variations": [ { - "featureEnabled": "false", + "featureEnabled": False, "id": "471185", "key": "off", "variables": [] @@ -245,7 +245,7 @@ ], "variations": [ { - "featureEnabled": "true", + "featureEnabled": True, "id": "16925940659", "key": "16925940659", "variables": [] @@ -273,7 +273,7 @@ ], "variations": [ { - "featureEnabled": "true", + "featureEnabled": True, "id": "16927890136", "key": "16927890136", "variables": [] @@ -306,7 +306,7 @@ ], "variations": [ { - "featureEnabled": "true", + "featureEnabled": True, "id": "16906801184", "key": "16906801184", "variables": [ @@ -320,7 +320,7 @@ }, { "id": "16932993089", - "value": "true" + "value": True }, { "id": "16937161477", @@ -346,7 +346,7 @@ ], "variations": [ { - "featureEnabled": "false", + "featureEnabled": False, "id": "471188", "key": "off", "variables": [ @@ -360,7 +360,7 @@ }, { "id": "16932993089", - "value": "true" + "value": True }, { "id": "16937161477", @@ -396,7 +396,7 @@ ], "variations": [ { - "featureEnabled": "true", + "featureEnabled": True, "id": "16931381940", "key": "16931381940", "variables": [] @@ -419,7 +419,7 @@ ], "variations": [ { - "featureEnabled": "false", + "featureEnabled": False, "id": "471189", "key": "off", "variables": [] @@ -447,7 +447,7 @@ ], "variations": [ { - "featureEnabled": "false", + "featureEnabled": False, "id": "471190", "key": "off", "variables": [] diff --git a/tests/acceptance/test_acceptance/test_config.py b/tests/acceptance/test_acceptance/test_config.py index 8df1f526..2f966aa4 100644 --- a/tests/acceptance/test_acceptance/test_config.py +++ b/tests/acceptance/test_acceptance/test_config.py @@ -14,7 +14,7 @@ "ab_test1": { "id": "16911963060", "key": "ab_test1", - "audiences": "Audience1", + "audiences": 'Audience1', "variationsMap": { "variation_1": { "id": "16905941566", @@ -33,7 +33,7 @@ "feature_2_test": { "id": "16910084756", "key": "feature_2_test", - "audiences": "Audience1", + "audiences": 'Audience1', "variationsMap": { "variation_1": { "id": "16925360560", @@ -58,7 +58,7 @@ { "id": "16911963060", "key": "ab_test1", - "audiences": "Audience1", + "audiences": 'Audience1', "variationsMap": { "variation_1": { "id": "16905941566", @@ -95,7 +95,7 @@ "ab_test1": { "id": "16911963060", "key": "ab_test1", - "audiences": "Audience1", + "audiences": 'Audience1', "variationsMap": { "variation_1": { "id": "16905941566", @@ -121,7 +121,7 @@ { "id": "16941022436", "key": "16941022436", - "audiences": "Audience1", + "audiences": 'Audience1', "variationsMap": { "16906801184": { "id": "16906801184", @@ -230,7 +230,7 @@ { "id": "16910084756", "key": "feature_2_test", - "audiences": "Audience1", + "audiences": 'Audience1', "variationsMap": { "variation_1": { "id": "16925360560", @@ -251,7 +251,7 @@ { "id": "16924931120", "key": "16924931120", - "audiences": "Audience1", + "audiences": 'Audience1', "variationsMap": { "16931381940": { "id": "16931381940", @@ -280,7 +280,7 @@ "feature_2_test": { "id": "16910084756", "key": "feature_2_test", - "audiences": "Audience1", + "audiences": 'Audience1', "variationsMap": { "variation_1": { "id": "16925360560", @@ -374,8 +374,8 @@ "audiences": [ { "id": "16902921321", - "name": "Audience1", - "conditions": "[and, [or, [or, {match: exact, name: attr_1, type: custom_attribute, value: hola}]]]" + "name": 'Audience1', + 'conditions': '["and", ["or", ["or", {"match": "exact", "name": "attr_1", "type": "custom_attribute", "value": "hola"}]]]' } ], "events": [ From 7920045133083a00e77dc206a1f22e2db27459ce Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 14:09:41 +0600 Subject: [PATCH 08/15] fix json --- tests/acceptance/datafile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/acceptance/datafile.py b/tests/acceptance/datafile.py index 1eb1c89e..33c28012 100644 --- a/tests/acceptance/datafile.py +++ b/tests/acceptance/datafile.py @@ -162,7 +162,7 @@ "type": "double" }, { - "defaultValue": True, + "defaultValue": "true", "id": "16932993089", "key": "bool_var", "type": "boolean" @@ -320,7 +320,7 @@ }, { "id": "16932993089", - "value": True + "value": "true" }, { "id": "16937161477", @@ -360,7 +360,7 @@ }, { "id": "16932993089", - "value": True + "value": "true" }, { "id": "16937161477", From 81d7080b0ce6922dc5d0138f7606527cd9114383 Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 14:24:15 +0600 Subject: [PATCH 09/15] fix json --- .../acceptance/test_acceptance/test_config.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/acceptance/test_acceptance/test_config.py b/tests/acceptance/test_acceptance/test_config.py index 2f966aa4..394cf4f7 100644 --- a/tests/acceptance/test_acceptance/test_config.py +++ b/tests/acceptance/test_acceptance/test_config.py @@ -14,7 +14,7 @@ "ab_test1": { "id": "16911963060", "key": "ab_test1", - "audiences": 'Audience1', + "audiences": "\\"Audience1\\"", "variationsMap": { "variation_1": { "id": "16905941566", @@ -33,7 +33,7 @@ "feature_2_test": { "id": "16910084756", "key": "feature_2_test", - "audiences": 'Audience1', + "audiences": "\\"Audience1\\"", "variationsMap": { "variation_1": { "id": "16925360560", @@ -58,7 +58,7 @@ { "id": "16911963060", "key": "ab_test1", - "audiences": 'Audience1', + "audiences": "\\"Audience1\\"", "variationsMap": { "variation_1": { "id": "16905941566", @@ -95,7 +95,7 @@ "ab_test1": { "id": "16911963060", "key": "ab_test1", - "audiences": 'Audience1', + "audiences": "\\"Audience1\\"", "variationsMap": { "variation_1": { "id": "16905941566", @@ -121,7 +121,7 @@ { "id": "16941022436", "key": "16941022436", - "audiences": 'Audience1', + "audiences": "\\"Audience1\\"", "variationsMap": { "16906801184": { "id": "16906801184", @@ -230,7 +230,7 @@ { "id": "16910084756", "key": "feature_2_test", - "audiences": 'Audience1', + "audiences": "\\"Audience1\\"", "variationsMap": { "variation_1": { "id": "16925360560", @@ -251,7 +251,7 @@ { "id": "16924931120", "key": "16924931120", - "audiences": 'Audience1', + "audiences": "\\"Audience1\\"", "variationsMap": { "16931381940": { "id": "16931381940", @@ -280,7 +280,7 @@ "feature_2_test": { "id": "16910084756", "key": "feature_2_test", - "audiences": 'Audience1', + "audiences": "\\"Audience1\\"", "variationsMap": { "variation_1": { "id": "16925360560", @@ -374,7 +374,7 @@ "audiences": [ { "id": "16902921321", - "name": 'Audience1', + "name": "\\"Audience1\\"", 'conditions': '["and", ["or", ["or", {"match": "exact", "name": "attr_1", "type": "custom_attribute", "value": "hola"}]]]' } ], From a6bd25c22c40d51e4a91a6e7e96aa4a81661941e Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 14:35:20 +0600 Subject: [PATCH 10/15] fix json --- tests/acceptance/test_acceptance/test_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/test_acceptance/test_config.py b/tests/acceptance/test_acceptance/test_config.py index 394cf4f7..2634aec7 100644 --- a/tests/acceptance/test_acceptance/test_config.py +++ b/tests/acceptance/test_acceptance/test_config.py @@ -375,7 +375,7 @@ { "id": "16902921321", "name": "\\"Audience1\\"", - 'conditions': '["and", ["or", ["or", {"match": "exact", "name": "attr_1", "type": "custom_attribute", "value": "hola"}]]]' + "conditions": "[\\"and\\", [\\"or\\", [\\"or\\", {\\"match\\": \\"exact\\", \\"name\\": \\"attr_1\\", \\"type\\": \\"custom_attribute\\", \\"value\\": \\"hola\\"}]]]" } ], "events": [ From a2c6d781cd7dfb01a0e564444f7bfaea4437d1e2 Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 14:43:35 +0600 Subject: [PATCH 11/15] fix json --- tests/acceptance/test_acceptance/test_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/test_acceptance/test_config.py b/tests/acceptance/test_acceptance/test_config.py index 2634aec7..ef99efa8 100644 --- a/tests/acceptance/test_acceptance/test_config.py +++ b/tests/acceptance/test_acceptance/test_config.py @@ -374,7 +374,7 @@ "audiences": [ { "id": "16902921321", - "name": "\\"Audience1\\"", + "name": "Audience1", "conditions": "[\\"and\\", [\\"or\\", [\\"or\\", {\\"match\\": \\"exact\\", \\"name\\": \\"attr_1\\", \\"type\\": \\"custom_attribute\\", \\"value\\": \\"hola\\"}]]]" } ], From eedd5cbfe847da87449376337a228d15e99006d0 Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 14:57:34 +0600 Subject: [PATCH 12/15] update test --- tests/acceptance/test_acceptance/test_decide.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/test_acceptance/test_decide.py b/tests/acceptance/test_acceptance/test_decide.py index 9f9ffe14..b5e4a906 100644 --- a/tests/acceptance/test_acceptance/test_decide.py +++ b/tests/acceptance/test_acceptance/test_decide.py @@ -164,7 +164,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": ["User \"matjaz\" was previously bucketed into variation \"variation_1\" of experiment \"ab_test1\"."]}, { From 404d1bc929165e71bb8f0989cdd964bdd99d5a75 Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 15:06:47 +0600 Subject: [PATCH 13/15] update test --- tests/acceptance/test_acceptance/test_decide.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/acceptance/test_acceptance/test_decide.py b/tests/acceptance/test_acceptance/test_decide.py index b5e4a906..9c4e98a0 100644 --- a/tests/acceptance/test_acceptance/test_decide.py +++ b/tests/acceptance/test_acceptance/test_decide.py @@ -156,10 +156,13 @@ 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, @@ -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, From 06b226a98723480f1e423115b11d8af21ec84e82 Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 15:14:47 +0600 Subject: [PATCH 14/15] fix test --- tests/acceptance/test_acceptance/test_decide.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/acceptance/test_acceptance/test_decide.py b/tests/acceptance/test_acceptance/test_decide.py index 9c4e98a0..6b39e319 100644 --- a/tests/acceptance/test_acceptance/test_decide.py +++ b/tests/acceptance/test_acceptance/test_decide.py @@ -217,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\"." + ] } ]""" From 994e2e39ae9c6cdd1bdbd1c4640acf4f541dde26 Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 23 Aug 2024 15:28:16 +0600 Subject: [PATCH 15/15] clean up --- config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yaml b/config.yaml index fa67c1b8..431ddd6c 100644 --- a/config.yaml +++ b/config.yaml @@ -38,7 +38,7 @@ tracing: enabled: false # opentelemetry tracing configuration opentelemetry: - ## bydefault stdout exporter is enabled (test) + ## bydefault stdout exporter is enabled ## to enable remote exporter set default as "remote" default: "stdout" ## tracing service name