-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve contextEnrichment to handle special cases. (#229)
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
- Loading branch information
Showing
2 changed files
with
50 additions
and
17 deletions.
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,50 @@ | ||
@contextEnrichment | ||
Feature: Context Enrichment | ||
|
||
Background: | ||
Given a stable flagd provider | ||
|
||
@in-process @rpc | ||
Scenario: Use enriched context | ||
Given a String-flag with key "flagd-context-aware" and a default value "not" | ||
When the flag was evaluated with details | ||
Then the resolved details value should be "INTERNAL" | ||
|
||
@grace @in-process | ||
Scenario: Use enriched context on connection error for IN-PROCESS | ||
Given a String-flag with key "flagd-context-aware" and a default value "not" | ||
And a stale event handler | ||
And a ready event handler | ||
When the flag was evaluated with details | ||
Then the resolved details value should be "INTERNAL" | ||
When the connection is lost for 6s | ||
And a stale event was fired | ||
When the flag was evaluated with details | ||
Then the resolved details value should be "INTERNAL" | ||
When a ready event was fired | ||
|
||
@grace @rpc | ||
Scenario: Use enriched context on connection error for RPC | ||
Given a String-flag with key "flagd-context-aware" and a default value "not" | ||
And a stale event handler | ||
And a ready event handler | ||
When the flag was evaluated with details | ||
Then the resolved details value should be "INTERNAL" | ||
When the connection is lost for 6s | ||
And a stale event was fired | ||
When the flag was evaluated with details | ||
Then the resolved details value should be "not" | ||
When a ready event was fired | ||
|
||
@rpc @caching | ||
Scenario: Use enriched context on RPC connection will not cache the value | ||
Given a String-flag with key "flagd-context-aware" and a default value "not" | ||
And a change event handler | ||
And a ready event handler | ||
When the flag was modified | ||
And a change event was fired | ||
And the flag was evaluated with details | ||
Then the reason should be "TARGETING_MATCH" | ||
# ensure that we do not cache a "TARGETING_MATCH", we should only cache evaluation with a "STATIC" reason | ||
When the flag was evaluated with details | ||
Then the reason should be "TARGETING_MATCH" |
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