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: fractional non-percentage and shorthand #132

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

toddbaert
Copy link
Member

@toddbaert toddbaert commented Jun 28, 2024

Adds a new fractional test and assertions. These don't require any new test implementation in consumers since they use existing clauses/bindings.

The new flag tests:

  • new, non-percentage weighting
  • defaulting to 1 if no weight is passed
  • default bucketing based on targeting key

I tested this locally with Java and it passes both RPC and in-process.

Comment on lines +33 to +36
Scenario Outline: Fractional operator shorthand
When a string flag with key "fractional-flag-shorthand" is evaluated with default value "fallback"
And a context containing a targeting key with value <targeting key>
Then the returned value should be <value>
Copy link
Member Author

Choose a reason for hiding this comment

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

These bindings already exist, so no new implementation code needs to be written. Consumers can just update the flagd image and the submodule containing the gherkin.

@toddbaert toddbaert closed this Jun 28, 2024
@toddbaert toddbaert reopened this Jun 28, 2024
Copy link
Member

@aepfli aepfli left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Member

@beeme1mr beeme1mr left a comment

Choose a reason for hiding this comment

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

Very cool! 🎉

@toddbaert toddbaert merged commit c673bf0 into main Jun 28, 2024
5 checks passed
@toddbaert toddbaert deleted the feat/new-fractional-test branch June 28, 2024 18:44
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.

4 participants