Skip to content

fix: add testcase with fractional with single entry#362

Open
leakonvalinka wants to merge 2 commits intoopen-feature:mainfrom
open-feature-forking:test/single-fractional-operator
Open

fix: add testcase with fractional with single entry#362
leakonvalinka wants to merge 2 commits intoopen-feature:mainfrom
open-feature-forking:test/single-fractional-operator

Conversation

@leakonvalinka
Copy link
Copy Markdown
Member

@leakonvalinka leakonvalinka commented Apr 3, 2026

This PR

  • adds a testcase with a flag with just a single fractional entry

Related Issues

part of open-feature/flagd#1924

Notes

the fractional operator still needs to be adjusted

Follow-up Tasks

How to test

Signed-off-by: Lea Konvalinka <lea.konvalinka@dynatrace.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new test case for fractional flags with a single entry to ensure they always resolve to the specified variant. The changes involve adding flag definitions to JSON files and corresponding Gherkin scenarios. The review feedback suggests correcting inconsistent step wording, adding version tags for broader test coverage, and reordering scenarios for better logical grouping.


@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"
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

Inconsistent step wording. This file uses fallback value (e.g., lines 12, 36, 54) instead of default value. Please update for consistency with the rest of the file to ensure the test harness correctly identifies the step.

    Given a String-flag with key "fractional-single-entry-flag" and a fallback value "fallback"

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.

resolved in following commit. is there a reason why the testcases in evaluator/ use "fallback" and the ones in targeting.feature use "default"?

| nine | clubs |
| two | spades |

@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, as the expected behavior for a single-entry fractional rule should be consistent across both bucketing implementations. Additionally, the placement of this scenario separates two related 'shared seed' scenarios (lines 53 and 81); moving it before line 53 or after line 102 would improve logical grouping.

| 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

Signed-off-by: Lea Konvalinka <lea.konvalinka@dynatrace.com>
@leakonvalinka leakonvalinka marked this pull request as ready for review April 3, 2026 09:49
@leakonvalinka leakonvalinka requested a review from a team as a code owner April 3, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant