-
Notifications
You must be signed in to change notification settings - Fork 51
Add gherkin tests to verify evaluation details in finally hooks #290
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
Merged
beeme1mr
merged 10 commits into
open-feature:main
from
chrfwow:Add-evaluation-details-to-finally-hook-stage-#403
Feb 7, 2025
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3aa2264
feat: Add evaluation details to finally hook stage #403
chrfwow a31ed83
fixup! feat: Add evaluation details to finally hook stage #403
chrfwow 3a47b13
fixup! feat: Add evaluation details to finally hook stage #403
chrfwow 2dff5ea
fixup! feat: Add evaluation details to finally hook stage #403
chrfwow 89dfff1
fixup! feat: Add evaluation details to finally hook stage #403
chrfwow e8ffce9
fixup! feat: Add evaluation details to finally hook stage #403
chrfwow 09f212b
fixup! feat: Add evaluation details to finally hook stage #403
chrfwow e4db403
fixup! feat: Add evaluation details to finally hook stage #403
chrfwow 5bae4d9
fixup! feat: Add evaluation details to finally hook stage #403
chrfwow 2e9bd7c
Merge branch 'main' into Add-evaluation-details-to-finally-hook-stage…
beeme1mr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| @hooks | ||
| Feature: Evaluation details through hooks | ||
|
|
||
| # This test suite contains scenarios to test the functionality of hooks. | ||
|
|
||
| Background: | ||
| Given a stable provider | ||
|
|
||
| Scenario: Passes evaluation details to after and finally hooks | ||
| Given a client with added hook | ||
| And a boolean-flag with key "boolean-flag" and a default value "false" | ||
| When the flag was evaluated with details | ||
| Then the "before" hook should have been executed | ||
| And the "after, finally after" hooks should be called with evaluation details | ||
| | data_type | key | value | | ||
| | string | flag_key | boolean-flag | | ||
| | boolean | value | true | | ||
| | string | variant | on | | ||
| | string | reason | STATIC | | ||
| | string | error_code | None | | ||
| | string | error_message | None | | ||
|
|
||
| # errors | ||
| Scenario: Flag not found | ||
| Given a client with added hook | ||
| And a string-flag with key "missing-flag" and a default value "uh-oh" | ||
| When the flag was evaluated with details | ||
| Then the "before" hook should have been executed | ||
| And the "error" hook should have been executed | ||
| And the "finally after" hooks should be called with evaluation details | ||
| | data_type | key | value | | ||
| | string | flag_key | missing-flag | | ||
| | string | value | uh-oh | | ||
| | string | variant | None | | ||
| | string | reason | ERROR | | ||
| | string | error_code | ErrorCode.FLAG_NOT_FOUND | | ||
beeme1mr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| | string | error_message | Flag 'missing-flag' not found | | ||
|
|
||
| Scenario: Type error | ||
| Given a client with added hook | ||
| And a string-flag with key "wrong-flag" and a default value "13" | ||
| When the flag was evaluated with details | ||
| Then the "before" hook should have been executed | ||
| And the "error" hook should have been executed | ||
| And the "finally after" hooks should be called with evaluation details | ||
| | data_type | key | value | | ||
| | string | flag_key | wrong-flag | | ||
| | integer | value | 13 | | ||
| | string | variant | None | | ||
| | string | reason | ERROR | | ||
| | string | error_code | ErrorCode.TYPE_MISMATCH | | ||
beeme1mr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| | string | error_message | Expected type <class 'int'> but got <class 'str'> | | ||
beeme1mr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.