From 9e1b98dcb6d15868ae8662e0c3fe9f04cd98212e Mon Sep 17 00:00:00 2001 From: lea konvalinka Date: Fri, 3 Apr 2026 11:21:15 +0200 Subject: [PATCH 1/2] fix: add testcase with fractional with single entry Signed-off-by: Lea Konvalinka --- evaluator/flags/testkit-flags.json | 13 +++++++++++++ evaluator/gherkin/fractional.feature | 6 ++++++ flags/custom-ops.json | 13 +++++++++++++ gherkin/targeting.feature | 6 ++++++ 4 files changed, 38 insertions(+) diff --git a/evaluator/flags/testkit-flags.json b/evaluator/flags/testkit-flags.json index 268e905..43df0d4 100644 --- a/evaluator/flags/testkit-flags.json +++ b/evaluator/flags/testkit-flags.json @@ -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" }, diff --git a/evaluator/gherkin/fractional.feature b/evaluator/gherkin/fractional.feature index f6a363b..dd39d67 100644 --- a/evaluator/gherkin/fractional.feature +++ b/evaluator/gherkin/fractional.feature @@ -72,6 +72,12 @@ Feature: Evaluator fractional operator | nine | clubs | | two | spades | + @fractional @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 default 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 "" diff --git a/flags/custom-ops.json b/flags/custom-ops.json index 85f5f9a..4749109 100644 --- a/flags/custom-ops.json +++ b/flags/custom-ops.json @@ -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": { diff --git a/gherkin/targeting.feature b/gherkin/targeting.feature index 5dd7ae2..966b8d5 100644 --- a/gherkin/targeting.feature +++ b/gherkin/targeting.feature @@ -67,6 +67,12 @@ Feature: Targeting rules | jon@company.com | heads | | jane@company.com | tails | + @fractional @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 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" From ba50e94e8020e88f56ab24c88bd78d167f0dca63 Mon Sep 17 00:00:00 2001 From: lea konvalinka Date: Fri, 3 Apr 2026 11:43:15 +0200 Subject: [PATCH 2/2] fix lint issue & consistency Signed-off-by: Lea Konvalinka --- evaluator/gherkin/fractional.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evaluator/gherkin/fractional.feature b/evaluator/gherkin/fractional.feature index dd39d67..3c55930 100644 --- a/evaluator/gherkin/fractional.feature +++ b/evaluator/gherkin/fractional.feature @@ -72,9 +72,9 @@ Feature: Evaluator fractional operator | nine | clubs | | two | spades | - @fractional @fractional-v2 + @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 default value "fallback" + 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"