-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
593 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
src/ConfigCat.Client.Tests/data/evaluationlog/1_targeting_rule.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"sdkKey": "PKDVCLf-Hq-h-kCzMp-L7Q/psuH7BGHoUmdONrzzUOY7A", | ||
"tests": [ | ||
{ | ||
"key": "stringContainsDogDefaultCat", | ||
"defaultValue": "default", | ||
"returnValue": "Cat", | ||
"expectedLog": "1_rule_no_user.txt" | ||
}, | ||
{ | ||
"key": "stringContainsDogDefaultCat", | ||
"defaultValue": "default", | ||
"user": { | ||
"Identifier": "12345" | ||
}, | ||
"returnValue": "Cat", | ||
"expectedLog": "1_rule_no_targeted_attribute.txt" | ||
}, | ||
{ | ||
"key": "stringContainsDogDefaultCat", | ||
"defaultValue": "default", | ||
"user": { | ||
"Identifier": "12345", | ||
"Email": "[email protected]" | ||
}, | ||
"returnValue": "Cat", | ||
"expectedLog": "1_rule_not_matching_targeted_attribute.txt" | ||
}, | ||
{ | ||
"key": "stringContainsDogDefaultCat", | ||
"defaultValue": "default", | ||
"user": { | ||
"Identifier": "12345", | ||
"Email": "[email protected]" | ||
}, | ||
"returnValue": "Dog", | ||
"expectedLog": "1_rule_matching_targeted_attribute.txt" | ||
} | ||
] | ||
} |
4 changes: 4 additions & 0 deletions
4
...t.Client.Tests/data/evaluationlog/1_targeting_rule/1_rule_matching_targeted_attribute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
INFO [5000] Evaluating 'stringContainsDogDefaultCat' for User '{"Identifier": "12345", "Email": "[email protected]", "Country": null, "Custom": null}' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email CONTAINS ANY OF ['@configcat.com'] THEN 'Dog' => MATCH, applying rule | ||
Returning 'Dog'. |
4 changes: 4 additions & 0 deletions
4
...nfigCat.Client.Tests/data/evaluationlog/1_targeting_rule/1_rule_no_targeted_attribute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
INFO [5000] Evaluating 'stringContainsDogDefaultCat' for User '{"Identifier": "12345", "Email": null, "Country": null, "Custom": null}' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email CONTAINS ANY OF ['@configcat.com'] THEN 'Dog' => no match | ||
Returning 'Cat'. |
6 changes: 6 additions & 0 deletions
6
src/ConfigCat.Client.Tests/data/evaluationlog/1_targeting_rule/1_rule_no_user.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
WARNING [3001] Cannot evaluate targeting rules and % options for setting 'stringContainsDogDefaultCat' (User Object is missing). You should pass a User Object to the evaluation methods like `get_value()` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/ | ||
INFO [5000] Evaluating 'stringContainsDogDefaultCat' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email CONTAINS ANY OF ['@configcat.com'] THEN 'Dog' => cannot evaluate, User Object is missing | ||
The current targeting rule is ignored and the evaluation continues with the next rule. | ||
Returning 'Cat'. |
4 changes: 4 additions & 0 deletions
4
...ient.Tests/data/evaluationlog/1_targeting_rule/1_rule_not_matching_targeted_attribute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
INFO [5000] Evaluating 'stringContainsDogDefaultCat' for User '{"Identifier": "12345", "Email": "[email protected]", "Country": null, "Custom": null}' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email CONTAINS ANY OF ['@configcat.com'] THEN 'Dog' => no match | ||
Returning 'Cat'. |
40 changes: 40 additions & 0 deletions
40
src/ConfigCat.Client.Tests/data/evaluationlog/2_targeting_rules.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"sdkKey": "PKDVCLf-Hq-h-kCzMp-L7Q/psuH7BGHoUmdONrzzUOY7A", | ||
"tests": [ | ||
{ | ||
"key": "stringIsInDogDefaultCat", | ||
"defaultValue": "default", | ||
"returnValue": "Cat", | ||
"expectedLog": "2_rules_no_user.txt" | ||
}, | ||
{ | ||
"key": "stringIsInDogDefaultCat", | ||
"defaultValue": "default", | ||
"user": { | ||
"Identifier": "12345" | ||
}, | ||
"returnValue": "Cat", | ||
"expectedLog": "2_rules_no_targeted_attribute.txt" | ||
}, | ||
{ | ||
"key": "stringIsInDogDefaultCat", | ||
"defaultValue": "default", | ||
"user": { | ||
"Identifier": "12345", | ||
"Custom1": "user" | ||
}, | ||
"returnValue": "Cat", | ||
"expectedLog": "2_rules_not_matching_targeted_attribute.txt" | ||
}, | ||
{ | ||
"key": "stringIsInDogDefaultCat", | ||
"defaultValue": "default", | ||
"user": { | ||
"Identifier": "12345", | ||
"Custom1": "admin" | ||
}, | ||
"returnValue": "Dog", | ||
"expectedLog": "2_rules_matching_targeted_attribute.txt" | ||
} | ||
] | ||
} |
5 changes: 5 additions & 0 deletions
5
...Client.Tests/data/evaluationlog/2_targeting_rules/2_rules_matching_targeted_attribute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
INFO [5000] Evaluating 'stringIsInDogDefaultCat' for User '{"Identifier": "12345", "Email": null, "Country": null, "Custom": {"Custom1": "admin"}}' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email IS ONE OF (hashed) ['a79a58142e...', '8af1824d6c...'] THEN 'Dog' => no match | ||
- IF User.Custom1 IS ONE OF (hashed) ['e01dfbe824...'] THEN 'Dog' => MATCH, applying rule | ||
Returning 'Dog'. |
5 changes: 5 additions & 0 deletions
5
...igCat.Client.Tests/data/evaluationlog/2_targeting_rules/2_rules_no_targeted_attribute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
INFO [5000] Evaluating 'stringIsInDogDefaultCat' for User '{"Identifier": "12345", "Email": null, "Country": null, "Custom": null}' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email IS ONE OF (hashed) ['a79a58142e...', '8af1824d6c...'] THEN 'Dog' => no match | ||
- IF User.Custom1 IS ONE OF (hashed) ['e01dfbe824...'] THEN 'Dog' => no match | ||
Returning 'Cat'. |
9 changes: 9 additions & 0 deletions
9
src/ConfigCat.Client.Tests/data/evaluationlog/2_targeting_rules/2_rules_no_user.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
WARNING [3001] Cannot evaluate targeting rules and % options for setting 'stringIsInDogDefaultCat' (User Object is missing). You should pass a User Object to the evaluation methods like `get_value()` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/ | ||
WARNING [3001] Cannot evaluate targeting rules and % options for setting 'stringIsInDogDefaultCat' (User Object is missing). You should pass a User Object to the evaluation methods like `get_value()` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/ | ||
INFO [5000] Evaluating 'stringIsInDogDefaultCat' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email IS ONE OF (hashed) ['a79a58142e...', '8af1824d6c...'] THEN 'Dog' => cannot evaluate, User Object is missing | ||
The current targeting rule is ignored and the evaluation continues with the next rule. | ||
- IF User.Custom1 IS ONE OF (hashed) ['e01dfbe824...'] THEN 'Dog' => cannot evaluate, User Object is missing | ||
The current targeting rule is ignored and the evaluation continues with the next rule. | ||
Returning 'Cat'. |
5 changes: 5 additions & 0 deletions
5
...nt.Tests/data/evaluationlog/2_targeting_rules/2_rules_not_matching_targeted_attribute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
INFO [5000] Evaluating 'stringIsInDogDefaultCat' for User '{"Identifier": "12345", "Email": null, "Country": null, "Custom": {"Custom1": "user"}}' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email IS ONE OF (hashed) ['a79a58142e...', '8af1824d6c...'] THEN 'Dog' => no match | ||
- IF User.Custom1 IS ONE OF (hashed) ['e01dfbe824...'] THEN 'Dog' => no match | ||
Returning 'Cat'. |
22 changes: 22 additions & 0 deletions
22
src/ConfigCat.Client.Tests/data/evaluationlog/and_rules.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"sdkKey": "configcat-sdk-1/XUbbCFZX_0mOU_uQ_XYGMg/FfwncdJg1kq0lBqxhYC_7g", | ||
"baseUrl": "https://test-cdn-eu.configcat.com", | ||
"tests": [ | ||
{ | ||
"key": "emailAnd", | ||
"defaultValue": "default", | ||
"returnValue": "Cat", | ||
"expectedLog": "and_rules_no_user.txt" | ||
}, | ||
{ | ||
"key": "emailAnd", | ||
"defaultValue": "default", | ||
"user": { | ||
"Identifier": "12345", | ||
"Email": "[email protected]" | ||
}, | ||
"returnValue": "Cat", | ||
"expectedLog": "and_rules_user.txt" | ||
} | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
src/ConfigCat.Client.Tests/data/evaluationlog/and_rules/and_rules_no_user.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
WARNING [3001] Cannot evaluate targeting rules and % options for setting 'emailAnd' (User Object is missing). You should pass a User Object to the evaluation methods like `get_value()` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/ | ||
INFO [5000] Evaluating 'emailAnd' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email STARTS WITH ANY OF (hashed) ['4_985cf0de...'] => False, skipping the remaining AND conditions | ||
THEN 'Dog' => cannot evaluate, User Object is missing | ||
The current targeting rule is ignored and the evaluation continues with the next rule. | ||
Returning 'Cat'. |
7 changes: 7 additions & 0 deletions
7
src/ConfigCat.Client.Tests/data/evaluationlog/and_rules/and_rules_user.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
INFO [5000] Evaluating 'emailAnd' for User '{"Identifier": "12345", "Email": "[email protected]", "Country": null, "Custom": null}' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email STARTS WITH ANY OF (hashed) ['4_985cf0de...'] => True | ||
AND User.Email CONTAINS ANY OF ['@'] => True | ||
AND User.Email ENDS WITH (hashed) ['20_37bff8e...'] => False, skipping the remaining AND conditions | ||
THEN 'Dog' => no match | ||
Returning 'Cat'. |
16 changes: 16 additions & 0 deletions
16
src/ConfigCat.Client.Tests/data/evaluationlog/circular_dependency.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"jsonOverride": "circular_dependency_override.json", | ||
"sdkKey": "", | ||
"baseUrl": "", | ||
"tests": [ | ||
{ | ||
"key": "key1", | ||
"defaultValue": "default", | ||
"user": { | ||
"Identifier": "1234" | ||
}, | ||
"returnValue": "first", | ||
"expectedLog": "circular_dependency.txt" | ||
} | ||
] | ||
} |
23 changes: 23 additions & 0 deletions
23
src/ConfigCat.Client.Tests/data/evaluationlog/circular_dependency/circular_dependency.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
WARNING [3005] Cannot evaluate targeting rules for 'key1' (circular dependency detected between the following depending flags: 'key1' -> 'key2' -> 'key1'). Please check your feature flag definition and eliminate the circular dependency. | ||
INFO [5000] Evaluating 'key1' for User '{"Identifier": "1234", "Email": null, "Country": null, "Custom": null}' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF flag 'key2' EQUALS 'fourth' | ||
( | ||
Evaluating prerequisite flag 'key2': | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF flag 'key1' EQUALS 'value1' | ||
( | ||
Evaluating prerequisite flag 'key1':THEN 'third' => Cannot evaluate targeting rules for 'key1' (circular dependency detected between the following depending flags: 'key1' -> 'key2' -> 'key1'). Please check your feature flag definition and eliminate the circular dependency. | ||
The current targeting rule is ignored and the evaluation continues with the next rule. | ||
- IF flag 'key3' EQUALS 'value3' | ||
( | ||
Evaluating prerequisite flag 'key3': | ||
Prerequisite flag evaluation result: 'value3' | ||
Condition: (Flag 'key3' EQUALS 'value3') evaluates to True. | ||
) | ||
THEN 'fourth' => MATCH, applying rule | ||
Prerequisite flag evaluation result: 'fourth' | ||
Condition: (Flag 'key2' EQUALS 'fourth') evaluates to True. | ||
) | ||
THEN 'first' => MATCH, applying rule | ||
Returning 'first'. |
21 changes: 21 additions & 0 deletions
21
...Cat.Client.Tests/data/evaluationlog/circular_dependency/circular_dependency_override.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"p": { | ||
"u": "https://cdn-global.configcat.com", | ||
"r": 0 | ||
}, | ||
"f": { | ||
"key1": { "v": { "s": "value1" }, | ||
"r": [ | ||
{"c": [{"d": {"f": "key2", "c": 0, "v": {"s": "fourth"}}}], "s": {"v": {"s": "first"}}}, | ||
{"c": [{"d": {"f": "key3", "c": 0, "v": {"s": "value3"}}}], "s": {"v": {"s": "second"}}} | ||
] | ||
}, | ||
"key2": { "v": { "s": "value2" }, | ||
"r": [ | ||
{"c": [{"d": {"f": "key1", "c": 0, "v": {"s": "value1"}}}], "s": {"v": {"s": "third"}}}, | ||
{"c": [{"d": {"f": "key3", "c": 0, "v": {"s": "value3"}}}], "s": {"v": {"s": "fourth"}}} | ||
] | ||
}, | ||
"key3": { "v": { "s": "value3" }} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/ConfigCat.Client.Tests/data/evaluationlog/options_after_targeting_rule.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"sdkKey": "PKDVCLf-Hq-h-kCzMp-L7Q/psuH7BGHoUmdONrzzUOY7A", | ||
"tests": [ | ||
{ | ||
"key": "integer25One25Two25Three25FourAdvancedRules", | ||
"defaultValue": 42, | ||
"returnValue": -1, | ||
"expectedLog": "options_after_targeting_rule_no_user.txt" | ||
}, | ||
{ | ||
"key": "integer25One25Two25Three25FourAdvancedRules", | ||
"defaultValue": 42, | ||
"user": { | ||
"Identifier": "12345" | ||
}, | ||
"returnValue": 2, | ||
"expectedLog": "options_after_targeting_rule_no_targeted_attribute.txt" | ||
}, | ||
{ | ||
"key": "integer25One25Two25Three25FourAdvancedRules", | ||
"defaultValue": 42, | ||
"user": { | ||
"Identifier": "12345", | ||
"Email": "[email protected]" | ||
}, | ||
"returnValue": 2, | ||
"expectedLog": "options_after_targeting_rule_not_matching_targeted_attribute.txt" | ||
}, | ||
{ | ||
"key": "integer25One25Two25Three25FourAdvancedRules", | ||
"defaultValue": 42, | ||
"user": { | ||
"Identifier": "12345", | ||
"Email": "[email protected]" | ||
}, | ||
"returnValue": 5, | ||
"expectedLog": "options_after_targeting_rule_matching_targeted_attribute.txt" | ||
} | ||
] | ||
} |
4 changes: 4 additions & 0 deletions
4
...options_after_targeting_rule/options_after_targeting_rule_matching_targeted_attribute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
INFO [5000] Evaluating 'integer25One25Two25Three25FourAdvancedRules' for User '{"Identifier": "12345", "Email": "[email protected]", "Country": null, "Custom": null}' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email CONTAINS ANY OF ['@configcat.com'] THEN '5' => MATCH, applying rule | ||
Returning '5'. |
7 changes: 7 additions & 0 deletions
7
...onlog/options_after_targeting_rule/options_after_targeting_rule_no_targeted_attribute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
INFO [5000] Evaluating 'integer25One25Two25Three25FourAdvancedRules' for User '{"Identifier": "12345", "Email": null, "Country": null, "Custom": null}' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email CONTAINS ANY OF ['@configcat.com'] THEN '5' => no match | ||
Evaluating % options based on the User.Identifier attribute: | ||
- Computing hash in the [0..99] range from User.Identifier => 25 (this value is sticky and consistent across all SDKs) | ||
- Hash value 25 selects % option 2 (50%), '2' | ||
Returning '2'. |
8 changes: 8 additions & 0 deletions
8
.../data/evaluationlog/options_after_targeting_rule/options_after_targeting_rule_no_user.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
WARNING [3001] Cannot evaluate targeting rules and % options for setting 'integer25One25Two25Three25FourAdvancedRules' (User Object is missing). You should pass a User Object to the evaluation methods like `get_value()` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/ | ||
WARNING [3001] Cannot evaluate % options for setting 'integer25One25Two25Three25FourAdvancedRules' (User Object is missing). You should pass a User Object to the evaluation methods like `get_value()` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/ | ||
INFO [5000] Evaluating 'integer25One25Two25Three25FourAdvancedRules' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email CONTAINS ANY OF ['@configcat.com'] THEN '5' => cannot evaluate, User Object is missing | ||
The current targeting rule is ignored and the evaluation continues with the next rule. | ||
Skipping % options because the User Object is missing. | ||
Returning '-1'. |
7 changes: 7 additions & 0 deletions
7
...ons_after_targeting_rule/options_after_targeting_rule_not_matching_targeted_attribute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
INFO [5000] Evaluating 'integer25One25Two25Three25FourAdvancedRules' for User '{"Identifier": "12345", "Email": "[email protected]", "Country": null, "Custom": null}' | ||
Evaluating targeting rules and applying the first match if any: | ||
- IF User.Email CONTAINS ANY OF ['@configcat.com'] THEN '5' => no match | ||
Evaluating % options based on the User.Identifier attribute: | ||
- Computing hash in the [0..99] range from User.Identifier => 25 (this value is sticky and consistent across all SDKs) | ||
- Hash value 25 selects % option 2 (50%), '2' | ||
Returning '2'. |
31 changes: 31 additions & 0 deletions
31
src/ConfigCat.Client.Tests/data/evaluationlog/options_based_on_custom_attr.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"sdkKey": "configcat-sdk-1/XUbbCFZX_0mOU_uQ_XYGMg/x0tcrFMkl02A65D8GD20Eg", | ||
"baseUrl": "https://test-cdn-eu.configcat.com", | ||
"tests": [ | ||
{ | ||
"key": "string75Cat0Dog25Falcon0HorseCustomAttr", | ||
"defaultValue": "default", | ||
"returnValue": "Chicken", | ||
"expectedLog": "options_custom_attribute_no_user.txt" | ||
}, | ||
{ | ||
"key": "string75Cat0Dog25Falcon0HorseCustomAttr", | ||
"defaultValue": "default", | ||
"user": { | ||
"Identifier": "12345" | ||
}, | ||
"returnValue": "Chicken", | ||
"expectedLog": "no_options_custom_attribute.txt" | ||
}, | ||
{ | ||
"key": "string75Cat0Dog25Falcon0HorseCustomAttr", | ||
"defaultValue": "default", | ||
"user": { | ||
"Identifier": "12345", | ||
"Country": "US" | ||
}, | ||
"returnValue": "Cat", | ||
"expectedLog": "matching_options_custom_attribute.txt" | ||
} | ||
] | ||
} |
5 changes: 5 additions & 0 deletions
5
...sts/data/evaluationlog/options_based_on_custom_attr/matching_options_custom_attribute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
INFO [5000] Evaluating 'string75Cat0Dog25Falcon0HorseCustomAttr' for User '{"Identifier": "12345", "Email": null, "Country": "US", "Custom": null}' | ||
Evaluating % options based on the User.Country attribute: | ||
- Computing hash in the [0..99] range from User.Country => 70 (this value is sticky and consistent across all SDKs) | ||
- Hash value 70 selects % option 1 (75%), 'Cat' | ||
Returning 'Cat'. |
4 changes: 4 additions & 0 deletions
4
...ent.Tests/data/evaluationlog/options_based_on_custom_attr/no_options_custom_attribute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
INFO [5000] Evaluating 'string75Cat0Dog25Falcon0HorseCustomAttr' for User '{"Identifier": "12345", "Email": null, "Country": null, "Custom": null}' | ||
Skipping % options because the User.Country attribute is missing. | ||
The current targeting rule is ignored and the evaluation continues with the next rule. | ||
Returning 'Chicken'. |
4 changes: 4 additions & 0 deletions
4
...ests/data/evaluationlog/options_based_on_custom_attr/options_custom_attribute_no_user.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
WARNING [3001] Cannot evaluate % options for setting 'string75Cat0Dog25Falcon0HorseCustomAttr' (User Object is missing). You should pass a User Object to the evaluation methods like `get_value()` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/ | ||
INFO [5000] Evaluating 'string75Cat0Dog25Falcon0HorseCustomAttr' | ||
Skipping % options because the User Object is missing. | ||
Returning 'Chicken'. |
20 changes: 20 additions & 0 deletions
20
src/ConfigCat.Client.Tests/data/evaluationlog/options_based_on_user_id.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"sdkKey": "PKDVCLf-Hq-h-kCzMp-L7Q/psuH7BGHoUmdONrzzUOY7A", | ||
"tests": [ | ||
{ | ||
"key": "string75Cat0Dog25Falcon0Horse", | ||
"defaultValue": "default", | ||
"returnValue": "Chicken", | ||
"expectedLog": "options_user_attribute_no_user.txt" | ||
}, | ||
{ | ||
"key": "string75Cat0Dog25Falcon0Horse", | ||
"defaultValue": "default", | ||
"user": { | ||
"Identifier": "12345" | ||
}, | ||
"returnValue": "Cat", | ||
"expectedLog": "options_user_attribute_user.txt" | ||
} | ||
] | ||
} |
5 changes: 5 additions & 0 deletions
5
...ient.Tests/data/evaluationlog/options_based_on_user_id/options_user_attribute_no_user.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
WARNING [3001] Cannot evaluate % options for setting 'string75Cat0Dog25Falcon0Horse' (User Object is missing). You should pass a User Object to the evaluation methods like `get_value()` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/ | ||
INFO [5000] Evaluating 'string75Cat0Dog25Falcon0Horse' | ||
Evaluating targeting rules and applying the first match if any: | ||
Skipping % options because the User Object is missing. | ||
Returning 'Chicken'. |
6 changes: 6 additions & 0 deletions
6
....Client.Tests/data/evaluationlog/options_based_on_user_id/options_user_attribute_user.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
INFO [5000] Evaluating 'string75Cat0Dog25Falcon0Horse' for User '{"Identifier": "12345", "Email": null, "Country": null, "Custom": null}' | ||
Evaluating targeting rules and applying the first match if any: | ||
Evaluating % options based on the User.Identifier attribute: | ||
- Computing hash in the [0..99] range from User.Identifier => 21 (this value is sticky and consistent across all SDKs) | ||
- Hash value 21 selects % option 1 (75%), 'Cat' | ||
Returning 'Cat'. |
Oops, something went wrong.