Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add empty context test #88

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions flags/edge-case-flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@
"targeting": {
"if": [true, true, false]
}
},
"empty-targeting-flag": {
"state": "ENABLED",
"variants": {
"false": 1,
"true": 2
},
"defaultVariant": "false",
"targeting": {}
}
}
}
7 changes: 4 additions & 3 deletions gherkin/flagd-json-evaluator.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: flagd json evaluation

# This test suite contains scenarios to test the json-evaluation of flagd and flag-in-process providers.
# It's associated with the flags configured in flags/changing-flag.json, flags/zero-flags.json, flags/custom-ops.json and evaluator-refs.json.
# It should be used in conjunection with the suites supplied by the OpenFeature specification.
# It should be used in conjunction with the suites supplied by the OpenFeature specification.

Background:
Given a flagd provider is set
Expand Down Expand Up @@ -42,7 +42,7 @@ Feature: flagd json evaluation
| "lmnopq" | "none" |
| 3 | "none" |

Scenario Outline: Semantic version operator numeric comparision
Scenario Outline: Semantic version operator numeric comparison
When a string flag with key "equal-greater-lesser-version-flag" is evaluated with default value "fallback"
And a context containing a key "version", with value <version>
Then the returned value should be <value>
Expand All @@ -54,7 +54,7 @@ Feature: flagd json evaluation
| "2.0.0-alpha" | "lesser" |
| "2.0.0.0" | "none" |

Scenario Outline: Semantic version operator semantic comparision
Scenario Outline: Semantic version operator semantic comparison
When a string flag with key "major-minor-version-flag" is evaluated with default value "fallback"
And a context containing a key "version", with value <version>
Then the returned value should be <value>
Expand Down Expand Up @@ -82,3 +82,4 @@ Feature: flagd json evaluation
| "error-targeting-flag" | 3 |
| "missing-variant-targeting-flag" | 3 |
| "non-string-variant-targeting-flag" | 2 |
| "empty-targeting-flag" | 1 |