-
Notifications
You must be signed in to change notification settings - Fork 39
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: Add new test suite for context merging #293
Open
chrfwow
wants to merge
1
commit into
open-feature:main
Choose a base branch
from
chrfwow:Add-new-test-suite-for-context-merging-#13
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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 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,49 @@ | ||
Feature: Context merging precedence | ||
|
||
Background: | ||
Given a stable provider with retrievable context is registered | ||
|
||
Scenario Outline: A context entry is added to a single level | ||
Given A context entry with key "key" and value "value" is added to the "<level>" level | ||
When Some flag was evaluated | ||
Then The merged context contains an entry with key "key" and value "value" | ||
|
||
Examples: | ||
| level | | ||
| API | | ||
| Transaction | | ||
| Client | | ||
| Invocation | | ||
| Before Hooks | | ||
|
||
Scenario: A context entry is added to each level with different keys | ||
Given A context entry with key "API" and value "API value" is added to the "API" level | ||
And A context entry with key "Transaction" and value "Transaction value" is added to the "Transaction" level | ||
And A context entry with key "Client" and value "Client value" is added to the "Client" level | ||
And A context entry with key "Invocation" and value "Invocation value" is added to the "Invocation" level | ||
And A context entry with key "Before Hooks" and value "Before Hooks value" is added to the "Before Hooks" level | ||
When Some flag was evaluated | ||
Then The merged context contains an entry with key "API" and value "API value" | ||
And The merged context contains an entry with key "Transaction" and value "Transaction value" | ||
And The merged context contains an entry with key "Client" and value "Client value" | ||
And The merged context contains an entry with key "Invocation" and value "Invocation value" | ||
And The merged context contains an entry with key "Before Hooks" and value "Before Hooks value" | ||
|
||
Scenario Outline: A context entry in one level overwrites values with the same key from preceding levels | ||
Given A table with levels of increasing precedence | ||
| API | | ||
| Transaction | | ||
| Client | | ||
| Invocation | | ||
| Before Hooks | | ||
And Context entries for each level from API level down to the "<level>" level with key "key" and value "<level>" | ||
When Some flag was evaluated | ||
Then The merged context contains an entry with key "key" and value "<level>" | ||
|
||
Examples: | ||
| level | | ||
| API | | ||
| Transaction | | ||
| Client | | ||
| Invocation | | ||
| Before Hooks | |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you prefer the same line with different values each time, or a data table for the
Given
andThen
parts of this scenario?