Skip to content
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
13 changes: 13 additions & 0 deletions evaluator/flags/testkit-flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,19 @@
]
}
},
"fractional-single-entry-flag": {
"state": "ENABLED",
"variants": {
"single": "single",
"fallback": "fallback"
},
"defaultVariant": "fallback",
"targeting": {
"fractional": [
[ "single", 1 ]
]
}
},
"semver-invalid-version-flag": {
"state": "ENABLED",
"variants": { "match": "match", "no-match": "no-match", "fallback": "fallback" },
Expand Down
6 changes: 6 additions & 0 deletions evaluator/gherkin/fractional.feature
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ Feature: Evaluator fractional operator
| nine | clubs |
| two | spades |

@fractional-v2
Scenario: Fractional operator with single entry always resolves to the only variant
Given a String-flag with key "fractional-single-entry-flag" and a fallback value "fallback"
When the flag was evaluated with details
Then the resolved details value should be "single"

Scenario Outline: Second fractional operator with shared seed
Given a String-flag with key "fractional-flag-B-shared-seed" and a fallback value "fallback"
And a context containing a nested property with outer key "user" and inner key "name", with value "<name>"
Expand Down
13 changes: 13 additions & 0 deletions flags/custom-ops.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@
]
}
},
"fractional-single-entry-flag": {
"state": "ENABLED",
"variants": {
"single": "single",
"fallback": "fallback"
},
"defaultVariant": "fallback",
"targeting": {
"fractional": [
[ "single", 1 ]
]
}
},
"fractional-flag-shorthand": {
"state": "ENABLED",
"variants": {
Expand Down
6 changes: 6 additions & 0 deletions gherkin/targeting.feature
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ Feature: Targeting rules
| jon@company.com | heads |
| jane@company.com | tails |

@fractional @fractional-v2
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This scenario is only tagged with @fractional-v2. Consider adding @fractional-v1 as well to ensure coverage for both bucketing implementations, as this test case is not specific to the v2 logic.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my understanding this is indeed just a fractional-v2 feature

Scenario: Fractional operator with single entry always resolves to the only variant
Given a String-flag with key "fractional-single-entry-flag" and a default value "fallback"
When the flag was evaluated with details
Then the resolved details value should be "single"

@fractional
Scenario Outline: Fractional operator with shared seed
Given a String-flag with key "fractional-flag-A-shared-seed" and a default value "fallback"
Expand Down
Loading